What this Capital Gains Tax Calculator does
When you sell a stock, piece of real estate, or other investment, the IRS taxes the profit differently depending on how long you held it. This English-language capital gains tax estimator applies current federal brackets to compute exactly what you owe — distinguishing short-term capital gains tax (assets held one year or less, taxed as ordinary income) from long-term capital gains tax rates (0%, 15%, or 20% depending on your taxable income). Enter your cost basis, sale price, and holding period and you get an instant, itemized breakdown. 100% client-side — your data never leaves your browser. No uploads, no tracking, no server logs. For a broader picture of how an investment grew before the sale, the [Investment ROI Calculator](/en/investment-roi-calculator/) pairs well with this tool. You can also model future growth using the [compound interest calculator](/en/compound-interest-calculator/).
Features
- Short- vs. long-term split. Automatically applies the correct tax treatment based on your holding period — ordinary income rates for short-term gains, preferential long-term capital gains tax rates for assets held more than a year.
- Current federal tax brackets. Uses up-to-date IRS capital gains tax brackets for single filers and married-filing-jointly, so the rate you see reflects what you'd actually owe at the federal level.
- Cost-basis input. Enter the original purchase price plus any commissions or fees to determine capital gains accurately — a step many online estimators skip.
- Effective rate display. Shows both the marginal capital gains tax rate and the effective rate on the gain, so you understand exactly what percentage of your profit goes to taxes.
- Privacy by design. All computation runs in JavaScript directly in your browser using the MDN — Intl.Segmenter-era client-side APIs. No figures you enter are transmitted to any server.
- Copyable result. One click copies the formatted tax estimate to your clipboard so you can paste it into a spreadsheet, email, or tax-prep document without retyping.
How to use the Capital Gains Tax Calculator
Fill in four fields and click Calculate — results appear instantly below the form.
- Enter your cost basis. Type the total amount you originally paid for the asset, including any brokerage commissions. Example:
42500for shares purchased at $42,500. - Enter the sale price. Type the gross proceeds from the sale before any selling costs. The calculator subtracts the basis to determine your net capital gain.
- Select your holding period. Choose short-term (≤ 365 days) or long-term (> 365 days). This single choice determines which set of tax brackets capital gains fall into.
- Enter your taxable income. Provide your estimated annual taxable income so the calculator can place you in the correct federal bracket for figuring capital gains tax.
- Review and copy the result. The result shows the gain amount, applicable CGT rate, and total tax owed. Hit Copy to grab a formatted summary for your records.
Common use cases
- Stock sale planning. An investor in New York holding appreciated tech shares can run this before selling to see whether waiting past the one-year mark drops their rate from 37% ordinary income to a 15% long-term capital gains tax rate — sometimes a meaningful difference.
- Real estate gains. Use the property gains tax calculator mode to estimate tax on the sale of a rental property or second home, factoring in your cost basis and any capital improvements.
- Crypto disposals. The IRS treats cryptocurrency as property, so each disposal is a taxable event. Determine capital gains on each lot separately by entering the per-lot basis and proceeds.
- Year-end tax-loss harvesting. Compare projected gains against losses to decide whether to harvest losses before December 31. Pair this with the [CAGR Calculator](/en/cagr-calculator/) to model the long-run cost of selling a position early.
- Freelancer asset sales. Designers or developers who sell digital assets, domain portfolios, or business equipment can use this to estimate their tax liability before filing estimated quarterly taxes.
Frequently asked questions
What is the difference between short-term and long-term capital gains tax?
Short-term capital gains apply to assets sold within one year of purchase and are taxed at your ordinary income rate — up to 37% federally. Long-term capital gains tax rates are 0%, 15%, or 20% depending on your income bracket, making the holding period one of the most impactful variables when figuring capital gains tax.
What are the 2024 long-term capital gains tax rates?
For 2024, the federal long-term CGT tax rates are 0% (taxable income up to ~$47,025 single / ~$94,050 MFJ), 15% (up to ~$518,900 single), and 20% above that. High earners may also owe the 3.8% Net Investment Income Tax on top of these rates.
Does this calculator store my financial data?
No. Every calculation runs entirely in your browser — no data is sent to any server, logged, or shared with third parties. This is a genuine privacy guarantee, not a marketing claim: the tool has no backend and makes no network requests with your inputs.
How do I determine capital gains on an asset I received as a gift?
Your basis is generally the donor's original basis (carryover basis), and your holding period includes the donor's holding period. Enter the donor's cost basis and the date they originally acquired the asset to get an accurate estimate.
Does the calculator handle the $250,000 / $500,000 home-sale exclusion?
The current version focuses on the federal capital gains tax brackets and rates. For primary residences, the IRS allows single filers to exclude up to $250,000 of gain ($500,000 MFJ) if you meet the ownership and use tests. Subtract that exclusion from your gain before entering it in the calculator.
Is this calculator accurate enough for tax filing?
It's designed as an estimator for planning purposes — the same role a [loan calculator](/en/loan-calculator/) plays for mortgage budgeting. Federal brackets are kept current, but state taxes, the NIIT surcharge, depreciation recapture, and other adjustments are not included. Always confirm figures with a CPA or the IRS publication for your situation, as noted in sources like FIPS 180-4 SHA-2-era standards guidance: tools assist humans, they don't replace professional review.