Capital Gains Tax Calculator
Enter what you paid, what you sold for and what else you earn – the gain is taxed on top of your other income. Selling your home applies the $250,000/$500,000 exclusion, and if you live in the Gulf or anywhere abroad, add the salary you exclude on Form 2555: it is not taxed, but it still sets the rate on your gain.
Quick answer: Selling for $35,000 a stock bought for $20,000 gives a $15,000 gain; held over a year, a single filer with $75,000 of other income pays $2,250 (15%) in 2026 federal capital gains tax – versus $3,300 if held a year or less. An American in Dubai who excludes a $120,000 salary pays $3,585 on a $40,000 long-term gain, because the excluded salary still pushes the gain into the 15% band.
Not rated yet · Updated · Free · No sign-up
Capital Gains Tax Calculator inputs
Result
Long-term capital gains tax
$2,250.00
15% of your $15,000.00 gain
| Sale price | $35,000.00 |
| Cost basis | −$20,000.00 |
| Capital gain | $15,000.00 |
| Federal tax at 0/15/20% rates | $2,250.00 |
| Net investment income tax (3.8%) | $0.00 |
| Total tax on the gain | $2,250.00 |
| You keep | $32,750.00 |
- Taxed at 0%
- $0
- Taxed at 15%
- $15,000
- Taxed at 20%
- $0
- Saved vs. short-term
- $1,050.00
2026 federal rates for single filers with the standard deduction. State tax and collectibles (28%) / real-estate depreciation recapture (25%) rates are not included.
Calculated with CalcBright – https://calcbright.com/capital-gains-tax-calculator on
Short-term vs. long-term
| Short-term (≤ 1 year) | Long-term (> 1 year) | |
|---|---|---|
| Federal income tax | $3,300.00 | $2,250.00 |
| NIIT (3.8%) | $0.00 | $0.00 |
| Total tax | $3,300.00 | $2,250.00 |
| Effective rate on gain | 22% | 15% |
2026 long-term capital gains brackets – single
| Rate | Taxable income (including the gain) |
|---|---|
| 0% | up to $49,450 |
| 15% | $49,450 – $545,500 |
| 20% | over $545,500 |
| +3.8% NIIT | MAGI over $200,000 |
How US capital gains tax works
When you sell a stock, fund, crypto coin or property for more than its cost basis – what you paid plus buying costs and improvements – the profit is a capital gain. The Internal Revenue Code taxes it in one of two ways. If you held the asset for more than one year, the gain is long-term and taxed at 0%, 15% or 20% under §1(h). If you held it a year or less, it is short-term and taxed like salary at 10% to 37%. On top of either, §1411 adds a 3.8% net investment income tax (NIIT) for higher incomes.
The rate is never chosen by the size of the gain alone. The gain is stacked on top of your other taxable income, so the same $15,000 profit is tax-free for a retiree with $40,000 of income and costs $2,820 for a single filer earning $300,000 – $2,250 at 15% plus $570 of NIIT. On a $100,000 gain that high earner pays $18,800, of which $3,800 is NIIT. That is why the calculator asks for your other income – and, if you live abroad, for the salary you exclude.
Gain = Sale price − Cost basis · Taxable income = Other income + Gain − Standard deduction · Long-term tax = the gain filling the 0%, 15% and 20% bands from where your ordinary taxable income ends · NIIT = 3.8% × min(Gain, MAGI − threshold)
Worked examples
A salaried investor in the US
A single filer earning $75,000 sells for $35,000 shares bought for $20,000. After the $16,100 standard deduction, ordinary taxable income is $58,900 – already past the $49,450 top of the 0% band – so the whole $15,000 gain is taxed at 15%: $2,250. Sold within a year, it would have been taxed at her 22% bracket: $3,300. Waiting saved $1,050.
An American engineer in Dubai
He earns $120,000 tax-free in the UAE and excludes all of it on Form 2555, so his only US income is a $40,000 long-term gain on shares bought for $10,000. A naive calculation says: $40,000 − $16,100 = $23,900 of taxable income, all inside the 0% band, tax $0. The Form 1040 Foreign Earned Income Tax Worksheet says otherwise. It adds the excluded $120,000 back to find the rate, then subtracts the tax on the excluded salary alone. The $23,900 therefore sits on top of $120,000 and is taxed at 15%: $3,585. He still keeps the full standard deduction, and the UAE levies no capital gains tax, so there is no foreign tax credit to reduce the bill.
A couple working in Riyadh
Both spouses exclude $132,900 each ($265,800 together) and file jointly. They sell a fund for $200,000 that cost $100,000. After the $32,200 joint standard deduction, $67,800 of the gain is taxable; stacked on $265,800 of excluded pay, all of it is in the 15% band: $10,170. For the NIIT their modified AGI is $365,800, because the excluded salaries are added back, which is $115,800 over the $250,000 threshold – so the full $100,000 gain bears 3.8%: $3,800. Total $13,970. Living in the US with no other income, the same couple would have paid $0.
2026 federal tax on a long-term gain, single filer
| Long-term gain | No other income | $75,000 US salary | Abroad, $132,900 salary excluded |
|---|---|---|---|
| $50,000 | $0 | $7,500 | $5,085 |
| $100,000 | $5,167.50 | $15,000 | $13,835.20 |
| $500,000 | $76,567.50 | $89,920 | $92,600.20 |
The expat column is lower than the US-salary column on smaller gains because the standard deduction, unused by excluded wages, shelters $16,100 of the gain. On large gains it overtakes: the excluded salary pushes more of the gain into the 20% band and into the 3.8% NIIT. The $500,000 rows include NIIT of $11,400, $14,250 and $16,450.20.
Rules that change the amount
- Your main home. Under §121 up to $250,000 of gain ($500,000 joint) is excluded if you owned and lived in the home for 2 of the 5 years before the sale and have not used the exclusion in the previous 2 years. Expats who rent out the US house after moving to the Gulf keep the full exclusion only if they sell within 3 years of moving out; a partial exclusion may apply if a job move forced an earlier sale. Depreciation claimed while renting is taxed at up to 25% regardless.
- Property abroad. A US citizen selling a flat in Dubai or Jeddah reports the gain in dollars: cost converted at the rate on the purchase date, price at the rate on the sale date. Because the dirham and riyal have been pegged to the dollar for decades (AED 3.6725, SAR 3.75), the gain in dollars mirrors the gain in local currency.
- Collectibles and real-estate depreciation. Gold, art and coins are taxed at up to 28%; unrecaptured depreciation on rental property at up to 25%. The calculator does not model these.
- Losses and wash sales. Net losses offset up to $3,000 of other income a year; buying the same security within 30 days of a loss sale disallows the loss.
- State tax. Most states tax gains as ordinary income. Moving to the Gulf does not always end state residency – some states keep taxing former residents who keep a home or ties there.
Common mistakes
- Assuming the foreign earned income exclusion or a tax-free Gulf salary makes investment gains tax-free.
- Counting the holding period wrongly: a share bought on 10 March 2025 becomes long-term when sold on or after 11 March 2026.
- Forgetting reinvested dividends in the cost basis and paying tax on them twice.
- Treating a crypto-to-crypto swap as tax-free – exchanging one coin for another is a sale.
- Non-US investors assuming US shares are tax-free in every respect: gains usually are, dividends are withheld at up to 30%, and US real estate is fully taxable.
When to get help
Use an enrolled agent or CPA who prepares expat returns if you hold non-US funds (they can fall under the punitive PFIC rules), sell rental or inherited property, have employer shares or options, or split the year between the US and the Gulf. Returns for 2026 are due on 15 April 2027, with an automatic extension to 15 June for citizens living abroad – interest still runs from April.
Estimates for general information based on 2026 federal rates. They do not include state tax, collectibles or depreciation recapture.
Estimates for educational purposes, not financial advice.
Frequently asked questions
What are the 2026 long-term capital gains tax brackets?
Long-term gains are taxed at 0% up to $49,450 of taxable income for single filers ($98,900 married filing jointly, $66,200 head of household), 15% up to $545,500 ($613,700 joint, $579,600 head of household, $306,850 married filing separately) and 20% above. The thresholds include the gain itself, so a $100,000 gain with no other income is taxed $5,167.50: 0% on $49,450 and 15% on $34,450.
How are short-term capital gains taxed?
An asset held one year or less is taxed as ordinary income at 10%–37%, stacked on your other income. For a single filer earning $75,000 a $15,000 short-term gain costs $3,300 (22%) against $2,250 if sold after more than a year – the day after the one-year anniversary of the purchase is the first long-term day.
I am an American working in Dubai – does the foreign earned income exclusion cover my capital gains?
No. The exclusion (up to $132,900 in 2026) covers wages, not investment gains, and the Foreign Earned Income Tax Worksheet taxes the gain as if it sat on top of the excluded salary. With a $120,000 salary excluded, a $40,000 long-term gain costs $3,585 instead of $0. The UAE has no capital gains tax, so there is no foreign tax to credit against the US bill.
I am not a US citizen and I live in the UAE – do I pay US tax when I sell US shares?
Generally not. A nonresident alien who spends fewer than 183 days in the US in the year owes no US tax on gains from selling shares; US dividends are a different matter and carry 30% withholding unless a tax treaty lowers it. US real estate is the exception: the buyer withholds 15% of the sale price under FIRPTA and the gain is taxed on a US return.
When does the 3.8% net investment income tax apply?
On the smaller of your investment income and the amount by which modified AGI exceeds $200,000 (single or head of household), $250,000 (joint) or $125,000 (separate) – figures fixed by law since 2013. Expats add excluded foreign earnings back into MAGI, so a single filer abroad with $132,900 excluded and a $200,000 gain pays $5,050.20 of NIIT, while the same filer without the exclusion pays none.
How much tax do I pay when I sell my home?
Up to $250,000 of gain ($500,000 married filing jointly) is tax-free if you owned and lived in the home for at least 2 of the 5 years before the sale. A married couple selling for $900,000 a home bought for $300,000, with $150,000 of other income, has $100,000 taxable after the exclusion and pays $15,000. The home does not have to be in the US: a Dubai apartment you live in qualifies too.
Can capital losses reduce my taxes?
Yes. Losses first offset gains, then up to $3,000 a year ($1,500 married filing separately) of other income, and the rest carries forward with no time limit. A $10,000 loss for a single filer earning $75,000 deducts $3,000 this year, saves $660 and carries $7,000 forward. A loss on your own home cannot be deducted.
How can I legally pay less capital gains tax?
Hold for more than a year, sell in a year your taxable income stays inside the 0% band (a retiree with $40,000 of income can realise a $20,000 gain tax-free in 2026), offset gains with losses, and give appreciated shares to charity instead of cash. If you sell at a loss and buy the same security within 30 days before or after, the wash-sale rule disallows the loss.
What changed
- – Page fully reviewed: key numbers, six scenarios, worked examples for Americans abroad, a gain-by-situation table and the home, loss and nonresident rules. The calculator now applies the main-home exclusion and, for expats, the Foreign Earned Income Tax Worksheet stacking rule and the NIIT add-back.
- – The 2026 thresholds took effect: the 0% band rose to $49,450 (single) and $98,900 (joint), and brokers began reporting cost basis for digital assets on Form 1099-DA.
- – Brokers started reporting the gross proceeds of crypto and other digital-asset sales on the new Form 1099-DA.
- – FIRPTA withholding on US real estate sold by foreign persons rose from 10% to 15% of the amount realized.
- – The 3.8% net investment income tax (IRC §1411) took effect, with thresholds of $200,000 / $250,000 that have never been indexed.
Sources
- Internal Revenue Code §1(h) (capital gains rates), §1211–1212 (loss limit and carryover), §121 (sale of principal residence), §911 (foreign earned income exclusion), §1411 (net investment income tax)
- IRS Rev. Proc. 2025-32 – 2026 inflation adjustments (§4.01 brackets, §4.03 capital gains thresholds, §4.14 standard deduction)
- IRS Topic No. 409 – Capital gains and losses
- IRS Topic No. 559 – Net investment income tax
- IRS Publication 523 – Selling Your Home
- IRS Form 1040 Instructions – Foreign Earned Income Tax Worksheet (line 16) and Publication 54 for citizens abroad
- IRS Publication 519 – U.S. Tax Guide for Aliens (capital gains of nonresident aliens) and FIRPTA withholding
Last reviewed: ·
Reviewed by Chelsea, CalcBright's animated guide, for the CalcBright editorial team · How we check our numbers
Rate the Capital Gains Tax Calculator
Only the average star rating is shown. Error reports go straight to our inbox so we can check and fix them. See our Methodology and privacy policy.