Back to Blog
payrollcaliforniacompliancelabor-lawfintech

California Overtime Calculation Software: Encoding Wage Law

How I built California overtime calculation software that handles daily OT, meal premiums at the Ferra rate, and Alvarado bonuses, tested against 29 court examples.

By Mike Hodgen

Short on time? Read the simplified version

Why California Wage Law Breaks Most Payroll Software

I run a small California company. That single fact means I operate on the most punishing wage-compliance surface in the country. And most payroll software has no idea what it's walking into.

The reason is simple. The vast majority of payroll tools were built for the federal standard, where overtime is a weekly thing: anything over 40 hours in a week gets time-and-a-half. Clean. Predictable. Wrong for California.

California stacks rules on top of that. Daily overtime over 8 hours. Double-time over 12. Seventh-consecutive-day premiums. Premium pay for meal and rest breaks that started late or never happened. None of that exists in the federal FLSA world, so the tools built for it either compute these things crudely or skip them entirely.

The PAGA math that ends companies

Here's why this matters at a level most operators underestimate. A single miscalculated meal premium isn't a rounding error. Under PAGA (the Private Attorneys General Act), one employee can sue on behalf of every employee, and penalties stack per pay period.

So a $3 underpayment on a meal premium, multiplied across 40 employees, across 26 pay periods, across a one-year lookback, becomes a six-figure liability before anyone has done anything malicious. I wrote more about why this specific structure makes precision non-negotiable in my piece on automating PAGA-exposed labor rules.

Where off-the-shelf tools cut corners

Most tools cut the same corners. They apply weekly OT but not daily. They pay break premiums at base rate instead of the regular rate (more on that disaster later). They use one bonus divisor for everything.

So the buyer's real question is fair: can software actually get California right?

Yes. But only when the doctrines are encoded explicitly and tested against the actual case law. Not approximated. Encoded.

Daily and Seventh-Day Overtime Without Pyramiding

The overtime rules in California aren't vague. They're a defined rule set, and any engine has to apply them in the right order.

The thresholds: 8h, 12h, and the seventh consecutive day

  • Over 8 hours in a workday: 1.5x
  • Over 12 hours in a workday: 2x (double-time)
  • Seventh consecutive day in a workweek: first 8 hours at 1.5x, beyond 8 at 2x

That's the surface. The hard part is what you do when these overlap with the federal weekly-40 rule.

Why you can't double-count the same hour

The doctrine is called no pyramiding. An hour that already counted as daily overtime cannot also be counted as weekly overtime. You pay the greater-of, once.

Flowchart showing the deterministic order California overtime is calculated to avoid pyramiding: daily OT applied first, hours locked, then weekly OT on remaining hours No-Pyramiding Overtime Calculation Order

The engine handles this by walking the data in a specific order. It takes raw time punches, reconstructs each workday, applies daily OT and double-time first, marks those hours as already-counted, then evaluates the workweek for any additional weekly OT on hours that weren't already premium.

Worked example. An employee works 10 hours Monday and 50 hours across the week.

Monday's 10 hours produce 8 regular and 2 daily-OT hours. Across the full week, they hit 50 hours, which is 10 over the federal 40. But 2 of those over-40 hours were already paid as daily OT on Monday. You don't pay them again. The engine credits the 2 daily-OT hours, then resolves the remaining weekly OT on hours not already counted as premium.

Get the order wrong and you either underpay (PAGA risk) or overpay (margin leak). Both are bad.

This part is deliberately not AI. It's deterministic code with a fixed rule order, because there is exactly one correct answer and the law supplies it. I explained why I keep this kind of logic deterministic with no AI allowed. An LLM guessing at overtime math is malpractice.

Meal and Rest Premiums Detected From Punch Times

This is where most software gives up. Break compliance isn't a setting you toggle. It's something you have to detect from when people actually clocked in and out.

The Brinker schedule: meal by the fifth hour

Under Brinker v. Superior Court, a 30-minute unpaid meal period must start before the end of the fifth hour of work. Work past five hours without a compliant meal, and you owe a premium.

Rest breaks follow a separate rule: a paid 10-minute rest period for every four hours worked (or major fraction). Miss one, owe a premium.

Second meals, waivers, and LC512

A second 30-minute meal is owed by the end of the tenth hour of work. Labor Code 512 allows waivers under specific conditions: a shift of six hours or less can waive the first meal by mutual consent; a shift of twelve hours or less can waive the second meal, but only if the first was actually taken.

The engine encodes these waiver conditions instead of assuming a waiver always applies. That distinction matters, because an improperly assumed waiver is itself a violation.

Computing the premium, not guessing it

The engine reads actual punch data. For each shift it asks: did a 30-minute meal start before the fifth hour ended? Was a second meal provided by the tenth hour when required? Were rest periods available at the right intervals?

Timeline showing California meal and rest break thresholds detected from punch data: rest breaks every 4 hours, first meal by hour 5, second meal by hour 10, with waiver conditions Meal and Rest Break Detection Timeline

When the answer is no and no valid waiver applies, it computes a premium of one hour of pay.

Worked example. An employee works a 9-hour shift but the punch data shows their lunch didn't start until 5 hours and 20 minutes in. That's a late meal under Brinker. The engine flags one meal premium for that shift.

One critical detail: that premium is one hour at the regular rate, not the base hourly rate. Almost everyone gets this wrong, which brings us to the single most expensive mistake in California payroll.

The Ferra Regular Rate: Why Premiums Aren't Paid at Base Pay

If I had to point to one rule that quietly generates more PAGA liability than any other, it's this one. And it's the one off-the-shelf tools almost universally miss.

What Ferra v. Loews changed

In 2021, the California Supreme Court decided Ferra v. Loews Hollywood Hotel. The holding: meal and rest premiums must be paid at the employee's "regular rate of compensation," which is the same blended regular rate used to calculate overtime, not the base hourly wage.

Before Ferra, plenty of employers (and their software) paid premiums at base pay. After Ferra, that's underpayment. And the ruling applied retroactively.

Folding in nondiscretionary pay

The regular rate of pay under Ferra blends in nondiscretionary earnings: nondiscretionary bonuses, shift differentials, and commissions. These inflate the rate above base.

Comparison showing premiums paid at $20 base rate versus the correct blended Ferra regular rate of $23, illustrating the $3 per-premium underpayment that accumulates into liability Ferra Regular Rate vs Base Pay Premium Error

The engine computes the regular rate per pay period by summing all qualifying earnings and dividing by hours worked, then applies that blended rate to every premium, not the base rate.

Worked example. An employee earns $20/hour base. In the pay period they also receive a nondiscretionary production bonus that, when blended in, raises their regular rate to $23/hour.

If your software pays meal and rest premiums at $20, every single premium is underpaid by $3. That doesn't sound like much. But multiply $3 across every missed break, every employee, every pay period in the lookback window, and add PAGA's stacked per-period penalties on top.

This is exactly how employers accumulate liability they cannot see. The premiums look like they're being paid. They're just being paid at the wrong rate. The keyword nobody in your payroll department has heard of, regular rate of pay Ferra, is the difference between compliant and exposed.

Flat-Sum Bonuses and the Alvarado Divisor

Here's another one that's small per check and enormous at scale. It comes down to a single division problem.

Flat-sum vs. production bonuses

In 2018, Alvarado v. Dart Container drew a line between two kinds of bonuses.

A flat-sum bonus is a fixed amount not tied to hours worked or output, like a $100 attendance bonus for showing up all week. A production bonus is tied to output: piece rate, commission, or anything that scales with how much you produce.

Why the divisor changes the overtime rate

When you fold a bonus into the regular rate for overtime, you divide it by hours. Alvarado held that for a flat-sum bonus, you divide only by the non-overtime hours worked, not total hours. Production bonuses use the standard total-hours divisor.

Comparison showing flat-sum bonuses divided by non-overtime hours versus production bonuses using total hours under the Alvarado ruling, with a worked $100 bonus example Alvarado Flat-Sum vs Production Bonus Divisor

Most software does one of two things wrong. It either ignores bonus impact on overtime entirely, or it applies the federal total-hours divisor to everything, including flat-sum bonuses. Both underpay overtime.

Worked example. A $100 flat-sum attendance bonus, employee worked 45 hours (40 regular, 5 OT).

Wrong way (total hours): $100 / 45 = $2.22/hr, then the half-time premium on 5 OT hours.

Alvarado way (non-overtime hours): $100 / 40 = $2.50/hr, applied to OT hours at the full premium multiplier the rule specifies.

The per-check difference is cents. Across a workforce and a multi-year lookback, it's a settlement.

The engine classifies each bonus by type at entry and routes it to the correct divisor. There's no universal divisor, because the law doesn't allow one.

Validating Against 29 Published Worked Examples

This is the part that should make a skeptical operator relax, because it answers "how do you know it's right?" with something better than "trust me."

Treating DLSE and court examples as test cases

Here's the thing about California wage law that nobody points out: the law supplies its own answer key. The DLSE enforcement manual and the published court opinions contain fully worked numeric examples. Given these exact inputs, here is the legally correct gross pay. Down to the dollar.

So I took every one of those worked examples and turned it into an automated test case. Inputs go in, the engine computes, and the result is compared against the number the DLSE or the court already published.

29 of 29 passing

The engine is currently verified against 29 of 29 published worked examples, covering daily OT, double-time, seventh-day rules, meal and rest premiums, the Ferra regular rate, and the Alvarado bonus divisors.

Dashboard showing the overtime engine verified against 29 of 29 published DLSE and court worked examples across all California wage doctrines, with edge cases flagged for human review 29 of 29 Validation Against Published Examples

That changes the entire conversation. "Is the software right?" stops being a lawyer's hope and becomes a green test suite. This is the same validation philosophy I described in replay every old result to prove it's right, applied to wage law instead of financial replay.

It's also why I built the payroll tax engine in-house rather than wiring up a black box. When the law is this punishing, you want to see the math and test it against the source.

One honest limitation. New case law and genuine edge cases require ongoing updates. The engine doesn't pretend to resolve every ambiguous scenario. When the inputs are unclear or fall outside the tested doctrines, it flags the case for human review rather than guessing. Guessing is how you turn a $3 error into a class action.

What This Means If You Run Payroll in California

California wage compliance is genuinely frightening, and it's supposed to be. The penalties were designed to deter, and PAGA hands enforcement to anyone with an attorney and a pay stub.

But here's what I want you to take away. The rules are not secret. The doctrines have names: Brinker, Ferra, Alvarado, Labor Code 512. The thresholds are published. The answer keys exist in the DLSE manual and the case law.

The reason most California companies are exposed isn't that the law is unknowable. It's that their payroll software was built for the federal 40-hour world and treats daily overtime, break premiums, the regular rate, and bonus divisors as edge cases (or doesn't handle them at all).

Software can get California right. It just has to encode the labor-law logic precisely and prove it against the actual cases instead of approximating.

So a practical question for you. If your current payroll tool is computing meal premiums at base pay instead of the Ferra regular rate, or applying the FLSA total-hours divisor to a flat-sum bonus, you may be accumulating liability nobody on your team can see in the numbers. It all looks paid. It's just paid wrong.

That's exactly the kind of thing I find and fix when I build or audit an earnings engine. Not slides about it. The actual math, tested against the law.

Want to explore what AI could do for your business?

Book a free 30-minute strategy call. No pitch deck, no sales team, just a real conversation about your operations and where AI (and the right deterministic code) actually fits.

Book a Discovery Call

Get AI insights for business leaders

Practical AI strategy from someone who built the systems — not just studied them. No spam, no fluff.

Ready to automate your growth?

Book a free 30-minute strategy call with Hodgen.AI.

Book a Strategy Call