When you see a US job offer that says “$120,000 per year”, that number is not what ends up in your bank account.
The United States payroll system includes multiple layers of taxes, each governed by different rules, rates, and income caps. Understanding how these pieces fit together is essential - not only for employees, but also for developers building finance tools or learning applied Python.
In this article, we will:
- Explain every major tax involved in US salary calculation
- Clarify rates, caps, and why they exist
- Clarify rates, caps, and why they exist
- Implement a complete Python program to compute net salary
This guide prioritizes clarity and correctness, not shortcuts.
What Is Gross Salary vs Net Salary?
Gross Salary
Your gross salary is the total compensation before any deductions:
- Base salary
- Bonuses (if annualized)
- Commission (if applicable)
Example:
Gross salary = $120,000 / year
Net Salary (Take-Home Pay)
Your net salary is what remains after all mandatory payroll taxes are deducted.
Net salary = Gross salary − Taxes − Payroll contributions
Mandatory Payroll Taxes in the United States
US payroll deductions fall into two major categories:
- Federal payroll taxes (FICA)
- Federal income tax
State and local taxes exist but vary widely, so we’ll exclude them to keep the model universal.
FICA Taxes (Payroll Contributions)
FICA stands for Federal Insurance Contributions Act.
These taxes fund US social programs.
| Rule | Value |
| Rate | 6.2% |
| Applies to | Earned income |
| Income cap | Yes (wage base limit) |
Only income up to a fixed annual cap is taxed.
Example:
- Wage base cap ≈ $168,600
- Income above that is not taxed for Social Security
Why?
Social Security benefits are capped, so contributions are capped as well.
2. Medicare Tax
| Rule | Value |
| Rate | 1.45% |
| Income cap | No |
| Additional Tax | +0.9% for very high earners |
For simplicity, we apply only the base 1.45% rate.
Federal Income Tax (The Most Complex Part)
Federal income tax in the US uses a progressive tax system.
What “Progressive” Means you do not pay one rate on your entire income.
Instead:
- Each portion of income is taxed at a different rate
- Higher income → higher marginal rate
Example Federal Tax Brackets (Single Filer, Simplified)
| Income Range (USD/Year) | Tax Rate |
| 0 - 11,000 | 10% |
| 11,001 - 44,725 | 12% |
| 44,726 - 95,375 | 22% |
| 95,376 - 182,100 | 32% |
| Above | 32% |
If you earn $120,000, part of your income is taxed at 10%, part at 12%, part at 22%, and part at 24%.
Overall Salary Calculation Flow
Gross Salary
→ Social Security (6.2%, capped)
→ Medicare (1.45%)
→ Federal Income Tax (progressive)
= Net Salary
Complete Python Program: US Salary Calculator
The program only requires one input parameter to run: annual_gross_salary. Scroll to the bottom of the code to find where you can enter this value.
You can also click this link https://python.codeutility.io/en/5uglkc to run the code directly in your browser.
"""
US Net Salary Calculator (Simplified)
====================================
This program calculates:
- Social Security tax
- Medicare tax
- Federal income tax (progressive)
- Annual & monthly net salary
⚠️ Simplifications:
- Single filer
- No state tax
- No deductions or credits
- No 401(k), insurance, or benefits
"""
# =====================================================
# TAX CONFIGURATION (ANNUAL)
# =====================================================
SOCIAL_SECURITY_RATE = 0.062 # 6.2%
MEDICARE_RATE = 0.0145 # 1.45%
SOCIAL_SECURITY_CAP = 168_600 # Max income taxed for Social Security
# Federal income tax brackets (Single filer, simplified)
FEDERAL_TAX_BRACKETS = [
(11_000, 0.10),
(44_725, 0.12),
(95_375, 0.22),
(182_100, 0.24),
(float("inf"), 0.32),
]
# =====================================================
# FEDERAL INCOME TAX CALCULATION
# =====================================================
def calculate_federal_income_tax(annual_income):
"""
Calculates federal income tax using progressive brackets.
annual_income: total gross income per year (USD)
"""
tax = 0
remaining_income = annual_income
previous_limit = 0
for limit, rate in FEDERAL_TAX_BRACKETS:
if remaining_income <= 0:
break
taxable_amount = min(remaining_income, limit - previous_limit)
tax += taxable_amount * rate
remaining_income -= taxable_amount
previous_limit = limit
return tax
# =====================================================
# MAIN SALARY CALCULATION
# =====================================================
def calculate_us_net_salary(
annual_gross_salary
):
"""
annual_gross_salary:
👉 Total salary before ANY deductions (USD)
👉 Example: 120000 means $120,000 per year
👉 Includes base salary, bonus, commission (annualized)
"""
# -----------------------------
# Social Security (6.2%, capped)
# -----------------------------
ss_taxable_income = min(
annual_gross_salary,
SOCIAL_SECURITY_CAP
)
social_security_tax = ss_taxable_income * SOCIAL_SECURITY_RATE
# -----------------------------
# Medicare (1.45%, no cap)
# -----------------------------
medicare_tax = annual_gross_salary * MEDICARE_RATE
# -----------------------------
# Federal Income Tax
# -----------------------------
federal_income_tax = calculate_federal_income_tax(
annual_gross_salary
)
# -----------------------------
# Net Salary
# -----------------------------
annual_net_salary = (
annual_gross_salary
- social_security_tax
- medicare_tax
- federal_income_tax
)
monthly_net_salary = annual_net_salary / 12
return {
"gross_salary": annual_gross_salary,
"social_security_tax": social_security_tax,
"medicare_tax": medicare_tax,
"federal_income_tax": federal_income_tax,
"annual_net_salary": annual_net_salary,
"monthly_net_salary": monthly_net_salary
}
# =====================================================
# EXAMPLE USAGE (INPUT SECTION)
# =====================================================
if __name__ == "__main__":
result = calculate_us_net_salary(
annual_gross_salary=120_000
# 👉 INPUT HERE
# Your total annual salary BEFORE taxes (USD)
# Example:
# - 60000 = $60,000/year
# - 120000 = $120,000/year
)
print("===== US SALARY BREAKDOWN =====")
print(f"Gross salary : ${result['gross_salary']:,.2f}")
print(f"Social Security tax : ${result['social_security_tax']:,.2f}")
print(f"Medicare tax : ${result['medicare_tax']:,.2f}")
print(f"Federal income tax : ${result['federal_income_tax']:,.2f}")
print("--------------------------------")
print(f"Annual net salary : ${result['annual_net_salary']:,.2f}")
print(f"Monthly net salary : ${result['monthly_net_salary']:,.2f}")