The basic formula: gross pay minus deductions equals net pay

Payroll taxes are calculated by taking your gross pay (what you earn before anything comes out) and applying tax rates set by federal, state, and sometimes local governments. The result is subtracted from your paycheck, leaving your net pay — the amount you actually receive. The calculation happens the same way whether you are paid weekly, biweekly, or monthly.

Your employer does the math, not you. They use your W-4 form (which you fill out when hired) to know how much to withhold, then run the calculation through payroll software or a payroll service. The withholding is an estimate — you may owe more or get a refund when you file taxes in April.

Key Takeaways

  • Federal income tax withholding is based on your W-4 form, which tells your employer how many allowances you claim and whether you have multiple jobs.
  • Social Security tax is 6.2 percent of your gross pay, up to a wage cap that changes each year (in 2024, the cap is $168,600).
  • Medicare tax is 1.45 percent of all your gross pay with no wage cap, plus an additional 0.9 percent if you earn over $200,000 as a single filer.
  • State and local income taxes vary by where you live and work; some states have no income tax, and some cities add their own tax on top.
  • Your employer matches Social Security and Medicare taxes on their own dime — you do not pay both halves.

Federal income tax withholding and your W-4

Federal income tax withholding is not a fixed percentage. Instead, your employer uses a W-4 form (the Employee's Withholding Certificate) to calculate how much to hold back. You complete this form when you start a job, and you can change it anytime — for example, if you get married, have a child, or take a second job.

The W-4 asks you to claim allowances or enter a dollar amount you want withheld. More allowances mean less money withheld from each paycheck. Fewer allowances mean more is withheld. The IRS provides a worksheet on the W-4 itself to help you estimate the right number, though many people guess or use the IRS withholding calculator online.

Your employer then looks up your withholding in IRS tables based on your pay frequency (weekly, biweekly, monthly) and your claimed allowances. The table tells them the exact dollar amount to withhold. This is why two people earning the same gross pay can have different federal tax withholdings — their W-4s are different.

Social Security tax: 6.2 percent up to the wage cap

Social Security tax is 6.2 percent of your gross pay. However, there is a wage cap — a maximum amount of income subject to the tax each year. In 2024, that cap is $168,600. Once you earn that much in a calendar year, no more Social Security tax is withheld from your paychecks for the rest of the year.

The wage cap changes annually based on wage growth. If you work for multiple employers in the same year, each one withholds 6.2 percent on your earnings with them, even if your combined earnings exceed the cap. You can claim a credit on your tax return if you overpaid, but it requires filing taxes.

Your employer also pays 6.2 percent Social Security tax on your behalf — you do not pay both halves. This employer portion does not appear on your paycheck, but it counts toward your Social Security record.

Medicare tax: 1.45 percent with no wage cap, plus 0.9 percent surcharge

Medicare tax is 1.45 percent of your gross pay, and there is no wage cap. You pay it on every dollar you earn, no matter how much you make in a year. Like Social Security, your employer also pays 1.45 percent on your behalf.

If you earn over a certain threshold, you owe an additional Medicare tax of 0.9 percent. The threshold is $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately. This additional tax applies only to income above the threshold and is withheld by your employer if your income crosses it during the year.

State and local income taxes vary by location

State income tax withholding depends on where you live and work. Nine states have no state income tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not wages). The remaining 41 states and Washington, D.C., all have income taxes, but the rates and rules differ.

Some states use a flat tax rate — everyone pays the same percentage. Others use a progressive system with multiple tax brackets, so your rate depends on how much you earn. You complete a state W-4 form (or equivalent) when hired, similar to the federal form, and your employer withholds based on that.

Some cities and counties also impose local income taxes on top of state tax. New York City, Philadelphia, and parts of Ohio are examples. If you work in a locality with a local tax, your employer withholds it separately. If you live in one place and work in another, the rules about which tax applies can be complex — your employer should handle it, but it is worth confirming.

How the calculation works in practice

Here is a concrete example. Suppose you earn $2,000 in a biweekly paycheck, you are single, you claimed two allowances on your W-4, and you live in a state with a 5 percent income tax and no local tax.

Your employer starts with your gross pay: $2,000. They look up the federal withholding for a biweekly paycheck with two allowances in the IRS table — let us say that comes to $180. They calculate Social Security tax: $2,000 × 0.062 = $124. They calculate Medicare tax: $2,000 × 0.0145 = $29. They calculate state income tax: $2,000 × 0.05 = $100. The total deductions are $180 + $124 + $29 + $100 = $433. Your net pay is $2,000 − $433 = $1,567.

Your pay stub will show all these line items separately so you can see exactly what came out and why. If you notice an error — for example, the wrong tax rate or a calculation mistake — contact your payroll department or HR to correct it.

What happens if too much or too little is withheld

Withholding is an estimate. If your employer withholds too much federal tax over the year, you will receive a refund when you file your tax return. If too little is withheld, you will owe money. The same applies to state and local taxes.

You can adjust your withholding anytime by submitting a new W-4 to your employer. If you expect a large refund, you might lower your allowances to bring home more money each paycheck. If you expect to owe, you might increase your allowances or ask your employer to withhold an extra dollar amount.

Self-employed people do not have an employer to withhold taxes, so they must calculate and pay estimated taxes themselves four times a year. That is a different process, but the tax rates and rules are the same.

Frequently Asked Questions

Why is my federal withholding different from my coworker's if we earn the same amount?

Your W-4 forms are different. Withholding depends on the allowances you claim, whether you have a second job, and whether you asked for extra withholding. Two people with identical gross pay can have very different federal taxes withheld based on their W-4 choices.

Does my employer pay taxes too?

Yes. Your employer pays 6.2 percent Social Security tax and 1.45 percent Medicare tax on your behalf. They also pay federal and state unemployment taxes. These employer taxes do not come out of your paycheck — they are a separate cost to the employer.

What if I work in one state but live in another?

Most states tax income based on where you work, not where you live. Your employer withholds tax for the state where your job is located. Some states have reciprocal agreements that change this rule, so check with your payroll department or the state tax authority if you are unsure.

Can I change my W-4 in the middle of the year?

Yes. You can submit a new W-4 anytime, and the new withholding takes effect on your next paycheck. This is useful if your life changes — for example, you get married, have a child, or take a second job.

What is the difference between withholding and owing taxes?

Withholding is money your employer holds back during the year and sends to the government on your behalf. Owing taxes is the actual amount you owe based on your income and tax brackets. When you file your return, the IRS compares what was withheld to what you owe and either refunds the difference or bills you.