{
  "slug": "capital-gains-tax",
  "title": "Capital Gains Tax Calculator",
  "heading": "Capital Gains Tax Calculator",
  "category": "financial",
  "url": "https://www.revenuelab.fyi/toolbox/capital-gains-tax",
  "summary": "Long-term vs short-term tax on an investment sale.",
  "description": "Holding past one year moves a gain from ordinary income rates to long-term rates of 0%, 15%, or 20% — often a 10–20 point swing on the same profit.",
  "formula": "Tax = (Proceeds − Basis − Losses) × applicable rate.",
  "dateModified": "2026-09-30",
  "run_url": "https://www.revenuelab.fyi/api/public/calc?tool=capital-gains-tax",
  "inputs": [
    {
      "id": "proceeds",
      "label": "Sale proceeds",
      "kind": "number",
      "hint": null,
      "default": 90000,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "basis",
      "label": "Cost basis",
      "kind": "number",
      "hint": null,
      "default": 45000,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "losses",
      "label": "Capital losses to offset",
      "kind": "number",
      "hint": null,
      "default": 0,
      "unit": "$",
      "min": 0,
      "max": null
    },
    {
      "id": "holding",
      "label": "Holding period",
      "kind": "select",
      "hint": null,
      "default": "long",
      "options": [
        {
          "value": "long",
          "label": "More than 1 year"
        },
        {
          "value": "short",
          "label": "1 year or less"
        }
      ]
    },
    {
      "id": "ltRate",
      "label": "Long-term rate",
      "kind": "number",
      "hint": null,
      "default": 15,
      "unit": "%",
      "min": 0,
      "max": 25
    },
    {
      "id": "ordinary",
      "label": "Ordinary income tax rate",
      "kind": "number",
      "hint": null,
      "default": 24,
      "unit": "%",
      "min": 0,
      "max": 50
    },
    {
      "id": "state",
      "label": "State tax rate",
      "kind": "number",
      "hint": null,
      "default": 5,
      "unit": "%",
      "min": 0,
      "max": 15
    },
    {
      "id": "niit",
      "label": "Subject to 3.8% net investment income tax?",
      "kind": "select",
      "hint": null,
      "default": "no",
      "options": [
        {
          "value": "no",
          "label": "No"
        },
        {
          "value": "yes",
          "label": "Yes"
        }
      ]
    }
  ],
  "outputs": [
    {
      "id": "total",
      "label": "Total capital gains tax",
      "format": "currency",
      "hint": null,
      "primary": true
    },
    {
      "id": "net",
      "label": "Profit after tax",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "gain",
      "label": "Taxable gain",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "fed",
      "label": "Federal tax",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "state",
      "label": "State tax",
      "format": "currency",
      "hint": null,
      "primary": false
    },
    {
      "id": "effective",
      "label": "Effective tax rate on the gain",
      "format": "percent",
      "hint": null,
      "primary": false
    }
  ],
  "worked_example": {
    "inputs": [
      "Sale proceeds: 90000 $",
      "Cost basis: 45000 $",
      "Capital losses to offset: 0 $",
      "Holding period: More than 1 year",
      "Long-term rate: 15 %",
      "Ordinary income tax rate: 24 %",
      "State tax rate: 5 %",
      "Subject to 3.8% net investment income tax?: No"
    ],
    "outputs": [
      "Total capital gains tax: $9,000.00",
      "Profit after tax: $36,000.00",
      "Taxable gain: $45,000.00",
      "Federal tax: $6,750.00",
      "State tax: $2,250.00",
      "Effective tax rate on the gain: 20.00%"
    ]
  },
  "how_to": {
    "title": "How to use this",
    "steps": [
      "Enter sale proceeds ($).",
      "Enter cost basis ($).",
      "Enter capital losses to offset ($).",
      "Enter holding period.",
      "Enter long-term rate (%).",
      "Enter ordinary income tax rate (%).",
      "Enter state tax rate (%).",
      "Enter subject to 3.8% net investment income tax?.",
      "Read your total capital gains tax on the right — it updates as you type.",
      "Hit Share to keep the scenario or send it to someone."
    ]
  },
  "scenarios": [
    {
      "name": "Conservative",
      "description": "Lower-end numbers — what if things land soft?",
      "values": {
        "proceeds": 54000,
        "basis": 27000,
        "losses": 0,
        "holding": "long",
        "ltRate": 9,
        "ordinary": 14,
        "state": 3,
        "niit": "no"
      }
    },
    {
      "name": "Typical",
      "description": "Defaults — the most common real-world setup.",
      "values": {
        "proceeds": 90000,
        "basis": 45000,
        "losses": 0,
        "holding": "long",
        "ltRate": 15,
        "ordinary": 24,
        "state": 5,
        "niit": "no"
      }
    },
    {
      "name": "Ambitious",
      "description": "Higher-end numbers — what if things really pop?",
      "values": {
        "proceeds": 144000,
        "basis": 72000,
        "losses": 0,
        "holding": "long",
        "ltRate": 24,
        "ordinary": 38,
        "state": 8,
        "niit": "no"
      }
    }
  ],
  "limitations": [
    "Results are estimates before tax, fees, and inflation unless an input explicitly covers them.",
    "Rates are treated as fixed for the whole period — variable-rate products will drift from this projection.",
    "This is educational maths, not financial advice. Check anything contractual with the lender or your accountant."
  ],
  "faq": [
    {
      "q": "How does the capital gains tax calculator work?",
      "a": "Holding past one year moves a gain from ordinary income rates to long-term rates of 0%, 15%, or 20% — often a 10–20 point swing on the same profit. The underlying maths is: Tax = (Proceeds − Basis − Losses) × applicable rate."
    },
    {
      "q": "What do I need to enter?",
      "a": "8 values: sale proceeds, cost basis, capital losses to offset, holding period, long-term rate, ordinary income tax rate, state tax rate, and subject to 3.8% net investment income tax?. Each field starts with a sensible default, so you can change one number at a time and watch the result move."
    },
    {
      "q": "What does the total capital gains tax result mean?",
      "a": "It is returned as a money amount in US dollars and updates live as you edit the inputs, so you can compare two or three versions of a scenario in a few seconds."
    },
    {
      "q": "Is this calculator free, and do I need an account?",
      "a": "Yes, it's free, and no account is required. Nothing you type is stored on our servers — the maths runs entirely in your browser."
    },
    {
      "q": "How accurate is the result?",
      "a": "It applies the standard formula exactly, so the arithmetic is precise. Results are estimates before tax, fees, and inflation unless an input explicitly covers them."
    },
    {
      "q": "Who is this tool for?",
      "a": "It's built for anyone comparing money scenarios before committing — budgeting a payment, sanity-checking a quote, or seeing what a change in rate or term actually costs."
    }
  ],
  "related": [
    "https://www.revenuelab.fyi/toolbox/stock-return",
    "https://www.revenuelab.fyi/toolbox/cost-basis",
    "https://www.revenuelab.fyi/toolbox/crypto-profit"
  ],
  "license": "CC-BY-4.0",
  "citation": "RevenueLab — Capital Gains Tax Calculator (https://www.revenuelab.fyi/toolbox/capital-gains-tax)"
}