The short answer

When a judgment of imprisonment is to be imposed for an offense with three possible terms, the court imposes no more than the middle term, except as section 1170 provides: when it may go above it, and how it may consider prior convictions (below).

Section 4019, in the version in effect until January 1, 2028, applies to custody in the cases it lists, with exceptions it sets out, some of them below. In those cases, for each four-day period of confinement, subject to subdivision (d), one day is deducted unless the record shows the person refused to satisfactorily perform assigned labor, and another unless the record shows they didn’t satisfactorily comply with the reasonable rules. No days are deducted unless the person is committed for four days or longer. If all those days are earned, the Legislature’s intent is that four days count as served for every two days in actual custody.

The Sheriff’s Department’s Theo Lacy page says: Sentenced people may be able to work in the kitchen or on labor crews and earn “work-time” credits that reduce their sentences. More: time off a jail sentence.

Official: Theo Lacy Facility (division page) (OC Sheriff’s Department), checked

What the Penal Code says

Choosing the term, and felonies punishable in county jail (Penal Code section 1170)

  • When a judgment of imprisonment is to be imposed and the statute for the offense gives three possible terms, the court, in its sound discretion, imposes a sentence no longer than the middle term. It may go above the middle term only when circumstances in aggravation justify it and the facts behind them were stipulated to by the defendant or found true beyond a reasonable doubt at trial, by the jury or by the judge in a court trial. Notwithstanding that, the court may consider the defendant’s prior convictions in determining the sentence, based on a certified record of conviction, without submitting them to a jury; this doesn’t apply to enhancements imposed on prior convictions.
  • The court imposes the lower term if any of these was a contributing factor in the offense: the person has experienced psychological, physical or childhood trauma; the person is a youth, or was one at the time of the offense, as section 1016.7(b) defines it; or the person is or was a victim of intimate partner violence or human trafficking, before or at the time of the offense. The exception is when the court finds that the aggravating circumstances outweigh the mitigating ones, so that the lower term would be contrary to the interests of justice. The court may also impose the lower term when none of those circumstances is shown.
  • Except as the next point says, a felony punishable under subdivision (h) is punishable by a county jail term: 16 months, two years or three years when the offense doesn’t specify the term, or otherwise the term the offense describes. The subdivision doesn’t prevent other dispositions the law allows, including pretrial diversion, deferred entry of judgment, or an order granting probation under section 1203.1.
  • An executed sentence for such a felony is served in state prison when the defendant has a prior or current conviction for a serious felony as described in section 1192.7(c) or a violent felony as described in section 667.5(c) (or a prior felony conviction in another jurisdiction for an offense with all the elements of one), is required to register as a sex offender under the chapter of the Penal Code that begins with section 290, or receives an enhancement under section 186.11.
  • When the court imposes a county jail term under paragraph (1) or (2) of subdivision (h), it suspends execution of a concluding part of the term, for a period it chooses, unless it finds, in the interest of justice, that this isn’t appropriate in the case. That part is called mandatory supervision: the county probation officer supervises the person, and unless the court orders otherwise it starts on release from physical custody or an alternative custody program, whichever is later.
The official text of the parts summarized

[…] (text omitted)

(b) (1) When a judgment of imprisonment is to be imposed and the statute specifies three possible terms, the court shall, in its sound discretion, order imposition of a sentence not to exceed the middle term, except as otherwise provided in paragraph (2).

(2) The court may impose a sentence exceeding the middle term only when there are circumstances in aggravation of the crime that justify the imposition of a term of imprisonment exceeding the middle term and the facts underlying those circumstances have been stipulated to by the defendant or have been found true beyond a reasonable doubt at trial by the jury or by the judge in a court trial. Except where evidence supporting an aggravating circumstance is admissible to prove or defend against the charged offense or enhancement at trial, or it is otherwise authorized by law, upon request of a defendant, trial on the circumstances in aggravation alleged in the indictment or information shall be bifurcated from the trial of charges and enhancements. The jury shall not be informed of the bifurcated allegations until there has been a conviction of a felony offense.

(3) Notwithstanding paragraphs (1) and (2), the court may consider the defendant’s prior convictions in determining sentencing based on a certified record of conviction without submitting the prior convictions to a jury. This paragraph does not apply to enhancements imposed on prior convictions.

[…] (text omitted)

(6) Notwithstanding paragraph (1), and unless the court finds that the aggravating circumstances outweigh the mitigating circumstances that imposition of the lower term would be contrary to the interests of justice, the court shall order imposition of the lower term if any of the following was a contributing factor in the commission of the offense:

(A) The person has experienced psychological, physical, or childhood trauma, including, but not limited to, abuse, neglect, exploitation, or sexual violence.

(B) The person is a youth or was a youth as defined under subdivision (b) of Section 1016.7 at the time of the commission of the offense.

(C) Prior to the instant offense, or at the time of the commission of the offense, the person is or was a victim of intimate partner violence or human trafficking.

(7) Paragraph (6) does not preclude the court from imposing the lower term even if there is no evidence of those circumstances listed in paragraph (6) present.

[…] (text omitted)

(h) (1) Except as provided in paragraph (3), a felony punishable pursuant to this subdivision where the term is not specified in the underlying offense shall be punishable by a term of imprisonment in a county jail for 16 months, or two or three years.

(2) Except as provided in paragraph (3), a felony punishable pursuant to this subdivision shall be punishable by imprisonment in a county jail for the term described in the underlying offense.

(3) Notwithstanding paragraphs (1) and (2), where the defendant (A) has a prior or current felony conviction for a serious felony described in subdivision (c) of Section 1192.7 or a prior or current conviction for a violent felony described in subdivision (c) of Section 667.5, (B) has a prior felony conviction in another jurisdiction for an offense that has all the elements of a serious felony described in subdivision (c) of Section 1192.7 or a violent felony described in subdivision (c) of Section 667.5, (C) is required to register as a sex offender pursuant to Chapter 5.5 (commencing with Section 290) of Title 9 of Part 1, or (D) is convicted of a crime and as part of the sentence an enhancement pursuant to Section 186.11 is imposed, an executed sentence for a felony punishable pursuant to this subdivision shall be served in the state prison.

(4) Nothing in this subdivision shall be construed to prevent other dispositions authorized by law, including pretrial diversion, deferred entry of judgment, or an order granting probation pursuant to Section 1203.1.

(5) (A) Unless the court finds, in the interest of justice, that it is not appropriate in a particular case, the court, when imposing a sentence pursuant to paragraph (1) or (2), shall suspend execution of a concluding portion of the term for a period selected at the court’s discretion.

(B) The portion of a defendant’s sentenced term that is suspended pursuant to this paragraph shall be known as mandatory supervision, and, unless otherwise ordered by the court, shall commence upon release from physical custody or an alternative custody program, whichever is later. During the period of mandatory supervision, the defendant shall be supervised by the county probation officer in accordance with the terms, conditions, and procedures generally applicable to persons placed on probation for the remaining unserved portion of the sentence imposed by the court. The period of supervision shall be mandatory and may not be earlier terminated, except by court order. Any proceeding to revoke or modify mandatory supervision under this subparagraph shall be conducted pursuant to either subdivisions (a) and (b) of Section 1203.2 or Section 1203.3. During the period when the defendant is under that supervision, unless in actual custody related to the sentence imposed by the court, the defendant shall be entitled to only actual time credit against the term of imprisonment imposed by the court. Any time period that is suspended because a person has absconded shall not be credited toward the period of supervision. A defendant who is subject to search or seizure as part of the terms and conditions of mandatory supervision, is subject to search or seizure only by a probation officer or other peace officer.

[…] (text omitted)

Version quoted: (Amended by Stats. 2025, Ch. 225, Sec. 2. (SB 551) Effective January 1, 2026.)

Official: Penal Code section 1170 on California Legislative Information, read

Days deducted for time in custody (Penal Code section 4019)

  • The section applies in the cases it lists. They include confinement in a county or city jail, industrial farm or road camp under a judgment of imprisonment (with all days of custody from arrest to the start of the sentence), confinement as a condition of probation, confinement after arrest and before sentencing for a felony conviction, and a sentence under section 1170(h).
  • For each four-day period of confinement, one day is deducted unless the record shows the person refused to satisfactorily perform labor as assigned (subject to subdivision (d)), and one day unless the record shows they didn’t satisfactorily comply with the reasonable rules and regulations.
  • The section doesn’t require the sheriff, chief of police or superintendent to assign labor to a person whose record shows they have refused to satisfactorily perform labor as assigned, or have not satisfactorily complied with the reasonable rules and regulations.
  • No days are deducted unless the person is committed for four days or longer.
  • The Legislature’s stated intent: if all days are earned, a term of four days is deemed served for every two days spent in actual custody.
  • The section doesn’t apply, and no credits may be earned, for periods of flash incarceration imposed under section 3000.08 or 3454.
  • The changes made by the act that added subdivision (h) apply prospectively, to people confined to a county jail, city jail, industrial farm or road camp for a crime committed on or after October 1, 2011. Days earned before October 1, 2011 are calculated at the rate the prior law required.
  • This is the version amended by Stats. 2023, Ch. 685, Sec. 3 (AB 1360), effective January 1, 2024. It remains in effect only until January 1, 2028, and is then repealed, unless a later law enacted before then deletes or extends that date. Its history note refers to a later operative version, which this guide doesn’t quote.
The official text of the parts summarized

(a) This section applies in all of the following cases:

(1) When a prisoner is confined in or committed to a county jail, industrial farm, or road camp or a city jail, industrial farm, or road camp, including all days of custody from the date of arrest to the date when the sentence commences, under a judgment of imprisonment or of a fine and imprisonment until the fine is paid in a criminal action or proceeding.

(2) When a prisoner is confined in or committed to a county jail, industrial farm, or road camp or a city jail, industrial farm, or road camp as a condition of probation after suspension of imposition of a sentence or suspension of execution of sentence in a criminal action or proceeding.

[…] (text omitted)

(4) When a prisoner is confined in a county jail, industrial farm, or road camp or a city jail, industrial farm, or road camp following arrest and prior to the imposition of sentence for a felony conviction.

[…] (text omitted)

(6) When a prisoner is confined in a county jail, industrial farm, or road camp or a city jail, industrial farm, or road camp as a result of a sentence imposed pursuant to subdivision (h) of Section 1170.

[…] (text omitted)

(b) Subject to subdivision (d), for each four-day period in which a prisoner is confined in or committed to a facility as specified in this section, one day shall be deducted from the prisoner’s period of confinement unless it appears by the record that the prisoner has refused to satisfactorily perform labor as assigned by the sheriff, chief of police, or superintendent of an industrial farm or road camp.

(c) For each four-day period in which a prisoner is confined in or committed to a facility as specified in this section, one day shall be deducted from the prisoner’s period of confinement unless it appears by the record that the prisoner has not satisfactorily complied with the reasonable rules and regulations established by the sheriff, chief of police, or superintendent of an industrial farm or road camp.

(d) This section does not require the sheriff, chief of police, or superintendent of an industrial farm or road camp to assign labor to a prisoner if it appears from the record that the prisoner has refused to satisfactorily perform labor as assigned or that the prisoner has not satisfactorily complied with the reasonable rules and regulations of the sheriff, chief of police, or superintendent of an industrial farm or road camp.

(e) A deduction shall not be made under this section unless the person is committed for a period of four days or longer.

(f) It is the intent of the Legislature that if all days are earned under this section, a term of four days will be deemed to have been served for every two days spent in actual custody.

[…] (text omitted)

(h) The changes to this section enacted by the act that added this subdivision shall apply prospectively and shall apply to prisoners who are confined to a county jail, city jail, industrial farm, or road camp for a crime committed on or after October 1, 2011. Any days earned by a prisoner prior to October 1, 2011, shall be calculated at the rate required by the prior law.

(i) (1) This section shall not apply, and no credits may be earned, for periods of flash incarceration imposed pursuant to Section 3000.08 or 3454.

[…] (text omitted)

(j) This section shall remain in effect only until January 1, 2028, and as of that date is repealed, unless a later enacted statute, that is enacted before January 1, 2028, deletes or extends that date.

Version quoted: (Amended (as amended by Stats. 2022, Ch. 756, Sec. 3) by Stats. 2023, Ch. 685, Sec. 3. (AB 1360) Effective January 1, 2024. Repealed as of January 1, 2028, by its own provisions. See later operative version, as amended by Sec. 4 of Stats. 2023, Ch. 685.)

Official: Penal Code section 4019 on California Legislative Information, read

Not legal advice

This is general information from the official text. It doesn’t say what applies to anyone’s case, or how many days a particular person will serve. Ask the defense attorney or the court; see the court locations.

Sources

Orange County Sheriff’s Department

Every fact above links to the official page it comes from, with the date we checked it. We quote official wording only where the exact words matter. See how we check facts.