WhatIPIP tools + free calculators
Tax · USD

Capital Gains Tax Calculator: Federal Tax on Stock and Investment Sales

Estimate US federal capital gains tax on a stock or investment sale. Includes long-term and short-term holding distinction and 2025 long-term brackets.

Capital Gains Tax Calculator (US Long-Term + Short-Term)

Your inputs
$
$
$
Used to determine the long-term capital gains bracket (0, 15, or 20 percent).
Results
Estimated federal capital gains tax
$750.00
Gross gain
$5,000.00
Holding period
Long-term (over 1 year)
Applicable rate
15.00%
Net proceeds after tax
$14,250.00
  • Federal only. State capital gains taxes vary widely; California taxes long-term gains as ordinary income, no state tax on gains in Texas/Florida/etc. Net Investment Income Tax (3.8%) applies above $200k single / $250k married for high earners.
Why this calculator

Capital gains tax in the US has two regimes based on how long you held the asset before selling. Short-term capital gains (held one year or less) are taxed as ordinary income at your marginal rate, the same as wages. Long-term capital gains (held more than one year) get a preferential rate of 0, 15, or 20 percent depending on your total taxable income for the year. The difference is large: a single filer in the 32 percent ordinary bracket pays 32 percent on a short-term gain versus 15 percent on the equivalent long-term gain.

This calculator takes purchase price (your cost basis), sale price, holding period in months, filing status, and your other taxable income for the year. It returns the gross gain or loss, the applicable holding-period classification, the tax rate that applies, the federal tax owed, and the net proceeds after tax. The calculator uses 2025 long-term brackets: 0 percent up to $48,350 (single) / $96,700 (married), 15 percent up to $533,400 (single) / $600,050 (married), and 20 percent above.

A rough sanity check: a $5,000 gain on stock held 18 months with $80,000 of other income lands in the 15 percent long-term bracket and owes $750 in federal tax. The same gain held 6 months would be short-term and taxed at the ordinary marginal rate, roughly 22 to 24 percent for the same income level. Holding 6 more months to cross the long-term threshold saves about $375 to $450 on the $5,000 gain.

The calculator does not handle state tax. California taxes long-term gains as ordinary income (no preferential rate). Texas, Florida, Tennessee, Nevada, Washington, Wyoming, South Dakota, and Alaska have no state income tax and therefore no state capital gains tax. Other states fall in between with their own brackets and treatment. For a complete tax picture on a gain, add state tax separately based on where you reside.

The deep dive

The long-term and short-term distinction

The holding period clock starts the day after you acquire the asset and ends the day you sell. Holding for exactly one year is short-term; holding for one year and one day is long-term. For most everyday investors trading individual stocks or ETFs, hitting the long-term threshold is often a simple matter of patience: most appreciation that triggers a sell decision can wait an extra few weeks or months if the long-term threshold is approaching.

The gap between short-term and long-term rates is large enough to matter. A high-bracket federal filer pays 37 percent on short-term gains and 20 percent on long-term gains, a 17-percentage-point difference. For a $50,000 gain that is $8,500 in extra tax owed if sold a day too early. Track your holding periods carefully if you frequently rebalance.

The 2025 long-term brackets

Long-term capital gains have their own bracket structure separate from ordinary income brackets. For 2025: single filers pay 0 percent up to $48,350 of total taxable income (including the gain), 15 percent up to $533,400, and 20 percent above. Married filing jointly: 0 percent up to $96,700, 15 percent up to $600,050, and 20 percent above. The brackets stack against your total taxable income; if you have $40,000 of ordinary income and $20,000 of long-term gain, the first $8,350 of gain is taxed at 0 percent (filling up to the $48,350 single threshold) and the remaining $11,650 is taxed at 15 percent.

This stacking creates planning opportunities. Years when you are between jobs, on parental leave, in a sabbatical, or otherwise in a lower-income year are good years to realise long-term gains; you may pay 0 percent or 15 percent on gains that would have been taxed at 20 percent in a high-income year. Tax-gain harvesting (intentionally realising long-term gains in a 0 percent year to reset cost basis) is a valid strategy.

Loss harvesting

Capital losses offset capital gains dollar-for-dollar within the same holding-period category (short-term losses offset short-term gains, long-term losses offset long-term gains, and net excess losses cross over to offset the other category). If you have net capital losses after the offset, up to $3,000 can offset ordinary income each year, with any remainder carried forward indefinitely to future years.

Loss harvesting is the practice of intentionally realising losses in years when you have offsetting gains, or in any year up to the $3,000 ordinary-income offset. The wash-sale rule prohibits buying back the same security (or a substantially identical one) within 30 days before or after the loss sale; violating the rule disallows the loss. To stay invested while harvesting, sell the losing position and immediately buy a substitute (different ETF, different sector ETF, etc.) that is similar but not identical.

Net Investment Income Tax (NIIT)

High-income filers also owe the 3.8 percent Net Investment Income Tax on investment income (including capital gains) above $200,000 of modified adjusted gross income for single filers, $250,000 for married filing jointly. The calculator does not include NIIT; if your income is above the threshold, add 3.8 percent to the effective rate on the portion of gain above the threshold.

What this calculator does not include

State capital gains tax (varies widely by state). Net Investment Income Tax (3.8 percent for high earners). Section 1202 qualified small business stock exclusion (up to 100 percent exclusion on certain QSBS held 5+ years). Section 1031 like-kind exchange deferral (real estate only since 2018). Section 121 home-sale exclusion ($250,000 single / $500,000 married for primary residences held 2+ years). Mark-to-market accounting for traders. Wash-sale rule violation effects on the deduction. Step-up in basis at death. Carryforward of net capital losses from prior years. For a complete tax picture, consult a CPA or use full-featured tax software; this calculator handles the standard taxable-account sale case at the federal level only.

Frequently asked questions

4 questions answered

Holding period of more than one year before selling qualifies for long-term treatment (preferential 0, 15, or 20 percent rates). Holding for one year or less is short-term and taxed at your ordinary marginal rate. The gap between the two is often 10 to 17 percentage points, so it pays to track holding periods carefully.

Related calculators

This calculator runs entirely in your browser. Your inputs are not stored or transmitted. Results are estimates and should not be taken as financial, legal, or tax advice. Default currency: USD. Locale: English.