What You're Actually Calculating
Payroll taxes are the amounts withheld from a worker's paycheck and the amounts an employer pays on top of wages. You are calculating two separate things: employee withholding (money taken from the worker's check) and employer taxes (money the employer owes). The employee portion comes out of gross pay before the worker sees it. The employer portion is a cost to the business on top of what it pays the worker.
The main payroll taxes are Social Security (6.2% employee, 6.2% employer), Medicare (1.45% employee, 1.45% employer), federal income tax withholding (varies by person), and state income tax withholding (varies by state). Some cities also charge local income tax. Unemployment insurance is employer-only in most states.
The calculation starts with gross pay — the total wages before any deductions. From there, you subtract pre-tax deductions (like health insurance premiums), apply tax rates to what remains, then subtract post-tax deductions (like garnishments). The result is net pay, what the worker actually receives.
Key Takeaways
- Social Security and Medicare are calculated as fixed percentages of gross pay up to an annual wage cap for Social Security ($168,600 in 2024, though this changes yearly).
- Federal income tax withholding depends on the worker's W-4 form, which lists their filing status, number of dependents, and other adjustments.
- Employer taxes (Social Security, Medicare, and unemployment insurance) are separate from employee withholding and are a direct cost to the business.
- State and local income tax rates vary by location and must be looked up for each jurisdiction where the worker lives or works.
- Pre-tax deductions like health insurance reduce the amount subject to income tax, but not Social Security and Medicare.
The Order of Calculation: Gross Pay to Net Pay
Start with gross pay — hourly rate times hours worked, or salary divided by pay periods. If the worker earns $20 per hour and works 40 hours, gross pay is $800.
Subtract pre-tax deductions next. These are health insurance premiums, 401(k) contributions, dependent care accounts, and similar items. These reduce the amount subject to federal income tax, state income tax, and local income tax — but not Social Security and Medicare. If the worker contributes $100 to health insurance and $50 to a 401(k), subtract $150. The amount left is now $650.
This $650 is the base for calculating Social Security and Medicare. Social Security is 6.2% of $650 = $40.30. Medicare is 1.45% of $650 = $9.43. (Social Security has a wage cap; once a worker hits the annual limit, no more Social Security tax is withheld that year.)
Federal income tax withholding is calculated using IRS tables and the worker's W-4 form. The tables account for filing status, pay frequency, and the adjustments the worker claimed. This is the most variable step and requires either IRS Publication 15-T tables or payroll software. For this example, assume federal withholding is $65.
State and local income tax are calculated the same way — as a percentage of the $650 (or sometimes gross pay, depending on the state). Assume state tax is $30 and local tax is $10.
Subtract post-tax deductions last. These are wage garnishments, court-ordered child support, and similar items that come out after taxes are calculated. Assume $20 in garnishment.
Net pay = $650 − $40.30 − $9.43 − $65 − $30 − $10 − $20 = $475.27. This is what the worker receives.
Social Security and Medicare Calculations
Social Security tax is 6.2% of gross pay (or of the amount after pre-tax deductions, depending on the deduction type). However, there is an annual wage cap. In 2024, no Social Security tax is withheld on earnings above $168,600. Once a worker hits that cap in a calendar year, you stop calculating Social Security tax for the rest of that year. Medicare has no wage cap.
Medicare tax is 1.45% of gross pay with no cap. Additionally, there is an Additional Medicare Tax of 0.9% on wages above $200,000 for single filers and $250,000 for married filers filing jointly (thresholds that apply per employer, not per job). This is withheld from the employee only, not matched by the employer.
Example: A worker earns $3,000 in a pay period. Social Security withholding is $3,000 × 0.062 = $186. Medicare withholding is $3,000 × 0.0145 = $43.50. If this worker has already earned $166,000 this year, only $2,600 of this check is subject to Social Security tax (to reach the $168,600 cap), so Social Security withholding would be $2,600 × 0.062 = $161.20 instead.
Federal Income Tax Withholding Using W-4 Information
Federal income tax withholding is not a flat percentage. It depends on the worker's W-4 form, which asks for filing status (single, married, head of household), number of dependents, and other income or adjustments. The IRS publishes withholding tables in Publication 15-T that show how much to withhold based on pay frequency, filing status, and the amounts claimed on the W-4.
The calculation works like this: take the worker's pay (after pre-tax deductions), look up the table for the pay frequency (weekly, biweekly, monthly, etc.), find the row matching the filing status and number of dependents, and read across to find the withholding amount. The tables account for the standard deduction and tax brackets automatically.
Example: A worker paid biweekly, single, with no dependents, earning $1,200 after pre-tax deductions. You would look at the biweekly table for single filers with zero dependents, find the row for $1,200, and the table tells you to withhold $95. If the worker claimed two dependents instead, the withholding would be lower because dependents reduce taxable income.
Many employers use payroll software that includes these tables built in, so you enter the W-4 information once and the software calculates withholding automatically each pay period. If you are doing this by hand, you must have access to the current IRS Publication 15-T.
State and Local Income Tax Withholding
State income tax withholding varies widely. Some states have no income tax (Florida, Texas, Wyoming, and others). States that do tax income use different methods: some use a flat percentage, others use brackets similar to federal tax. Some states allow workers to claim dependents; others do not.
You must look up the rules for each state where the worker lives or works. Most state revenue departments publish withholding tables or provide online calculators. Local income tax (charged by some cities and counties) is usually a flat percentage of gross pay or taxable income.
Example: A worker in Ohio earning $1,200 after pre-tax deductions would owe Ohio state income tax based on Ohio's tax tables. A worker in Pennsylvania earning the same amount would owe Pennsylvania state tax based on Pennsylvania's tables. A worker in Florida earning $1,200 owes no state income tax. If either worker lives in a city that charges local income tax (like Columbus, Ohio or Philadelphia, Pennsylvania), that is calculated separately and withheld as well.
Employer Tax Obligations
The employer must pay taxes on top of the worker's wages. These are not withheld from the worker's check; they are a business expense. Employer Social Security tax is 6.2% of gross pay (subject to the same $168,600 annual cap as employee withholding). Employer Medicare tax is 1.45% of gross pay with no cap.
Federal Unemployment Insurance (FUTA) is 6.0% of the first $7,000 of each worker's annual wages (this cap resets January 1 each year). However, employers receive a credit of up to 5.4% if they pay state unemployment insurance on time, so the effective federal rate is usually 0.6%. State Unemployment Insurance (SUTA) varies by state and by industry risk classification, ranging from less than 1% to over 5% of payroll.
Example: An employer with one worker earning $3,000 in a pay period owes $3,000 × 0.062 = $186 in employer Social Security tax and $3,000 × 0.0145 = $43.50 in employer Medicare tax. If this is the worker's first pay period of the year, the employer also owes $3,000 × 0.006 = $18 in federal unemployment tax (after the 5.4% credit) and the state unemployment rate (assume 2.5%) = $3,000 × 0.025 = $75 in state unemployment tax. Total employer taxes for this check: $322.50.
Common Mistakes in Payroll Tax Calculation
Forgetting to apply the Social Security wage cap is a frequent error. Once a worker reaches $168,600 in earnings for the year (2024), you stop withholding Social Security tax, but you continue withholding Medicare tax and federal income tax. Failing to stop can result in over-withholding and a refund the worker has to claim later.
Confusing pre-tax and post-tax deductions is another common mistake. Health insurance, 401(k) contributions, and dependent care accounts reduce the amount subject to income tax but not Social Security and Medicare. Garnishments and post-tax deductions come out after all taxes are calculated. Applying them in the wrong order changes the tax amounts.
Using outdated withholding tables or W-4 information causes incorrect federal income tax withholding. The IRS updates Publication 15-T annually, and workers may change their W-4 at any time. If you are using last year's tables or an old W-4, your withholding will be wrong.
Forgetting state and local taxes is less common in payroll software but happens when calculating by hand. Each state and locality has different rules, rates, and caps. You must research the requirements for every location where you have workers.
Frequently Asked Questions
What is the difference between gross pay and taxable income?
Gross pay is total wages before any deductions. Taxable income is what remains after pre-tax deductions are subtracted. Social Security and Medicare are calculated on gross pay (or on pay after certain pre-tax deductions). Federal, state, and local income taxes are calculated on taxable income.
Do I have to withhold taxes if a worker is paid under the table?
Yes. All workers, regardless of how they are paid, are subject to payroll taxes. Failing to withhold and remit taxes is illegal and exposes the employer to penalties, interest, and criminal liability. The method of payment (cash, check, direct deposit) does not change the tax obligation.
What happens if I withhold too much or too little federal income tax?
If you withhold too much, the worker receives a refund when they file their tax return. If you withhold too little, they owe taxes when they file. Workers can adjust their W-4 at any time to increase or decrease withholding for future pay periods. The employer is responsible for withholding accurately based on the W-4 the worker provides.
Do I need to calculate payroll taxes differently for salaried versus hourly workers?
No. The calculation method is the same. The only difference is how you determine gross pay: hourly workers are paid by hours worked, salaried workers by their annual salary divided by the number of pay periods. Once you have gross pay, the tax calculations are identical.
What if a worker has multiple jobs?
Each employer withholds federal income tax based on the W-4 the worker provides to that employer. The worker may end up over-withheld or under-withheld if their combined income across jobs is higher than either employer expects. The worker can adjust their W-4 at each job or claim additional withholding to correct this. Social Security and Medicare are withheld by each employer up to the annual cap, so a worker with two jobs may hit the cap at one employer and continue paying at the other.