If you're building a budget tool, comparing job offers, or just checking a pay stub, three California paycheck lines are pure arithmetic: Social Security, Medicare and State Disability Insurance (SDI). Federal and state income tax withholding need the full employer formulas, but these three only need a rate, a cap and a running total for the year.
Here's a small model of those three lines, with the 2026 numbers and the one change already announced for 2027.
The rules
- Social Security: 6.2% of wages, but only up to the yearly wage base. For 2026 the wage base is $184,500, so the most an employee pays is $11,439.
- Medicare: 1.45% of all wages, with no cap. Once an employee's wages for the year pass $200,000, the employer also withholds an extra 0.9% on the amount above that line, whatever the filing status. IRS Topic 751
- California SDI: 1.3% of all wages in 2026. Since January 1, 2024, there's no wage limit, so SDI applies to every dollar. The EDD has announced 1.4% for 2027. EDD rates and withholding
The caps are why these lines need a year-to-date total. A paycheck late in the year can owe less Social Security, or more Medicare, than one in January.
The code
SS_RATE, SS_WAGE_BASE = 0.062, 184_500 # 2026
MEDICARE_RATE = 0.0145
ADDL_MEDICARE_RATE, ADDL_THRESHOLD = 0.009, 200_000
SDI_RATE = {2026: 0.013, 2027: 0.014} # California EDD
def payroll_lines(gross: float, ytd_before: float, year: int = 2026) -> dict:
"""Social Security, Medicare and CA SDI for one paycheck."""
ytd_after = ytd_before + gross
ss_taxable = max(0.0, min(ytd_after, SS_WAGE_BASE) - min(ytd_before, SS_WAGE_BASE))
addl_taxable = max(0.0, ytd_after - max(ytd_before, ADDL_THRESHOLD))
return {
"social_security": round(ss_taxable * SS_RATE, 2),
"medicare": round(gross * MEDICARE_RATE + addl_taxable * ADDL_MEDICARE_RATE, 2),
"ca_sdi": round(gross * SDI_RATE[year], 2),
}
ss_taxable is the part of this paycheck that falls under the wage base. addl_taxable is the part above $200,000. Both are zero most of the year for most people, which is exactly why a simple "rate times gross" model drifts at the edges.
Trying it
A $120,000 salary paid every two weeks is $4,615.38 per check:
gross = 120_000 / 26
print(payroll_lines(gross, ytd_before=0))
# {'social_security': 286.15, 'medicare': 66.92, 'ca_sdi': 60.0}
print(payroll_lines(gross, ytd_before=0, year=2027))
# {'social_security': 286.15, 'medicare': 66.92, 'ca_sdi': 64.62}
The 2027 SDI change adds about $4.62 per check at this salary, roughly $120 over the year.
For a $250,000 salary, Social Security stops partway through the year once wages pass $184,500, while SDI keeps going on every check: $3,250 for 2026 at 1.3%.
What this model leaves out
- Federal income tax withholding, which follows IRS Publication 15-T and the employee's W-4.
- California income tax withholding, which follows the state's employer formula and Form DE 4.
- Pre-tax deductions. A traditional 401(k) lowers income tax wages but not Social Security or Medicare wages. Section 125 health premiums lower both.
Those pieces are where most of the code goes. If you'd rather not build them, this California paycheck calculator runs the 2026 federal tables and California's 2026 formula and shows every line separately. It's part of WhereMyRefund, an independent site that is not affiliated with the IRS or the State of California.
Top comments (0)