Income Tax Calculator
Calculate your federal income tax with bracket breakdown.
Calculate your capital gains tax on stocks, crypto, real estate, and other investments. Compare short-term vs long-term rates, estimate the NIIT, and plan your investment tax strategy.
Improvements, commissions, fees
Wages, salary, other income (affects LT bracket)
Net Capital Gain
$30,000.00
Capital Gains Tax
$4,500.00
Net After Tax
$75,500.00
Effective Tax Rate
15.0%
Short-term gains are taxed as ordinary income, which is typically higher than long-term rates.
Long-Term Tax Savings: $2,100.00
By holding your investment for more than one year, you could save $2,100.00 in taxes on this transaction. Long-term capital gains are taxed at preferential rates (0%, 15%, or 20%) compared to ordinary income rates.
This calculator provides estimates based on 2024 federal tax rules. Long-term capital gains rates depend on your taxable income. The Net Investment Income Tax (NIIT) of 3.8% applies when your modified AGI exceeds $200,000 (single) or $250,000 (MFJ). Consult a tax professional for personalized advice.
Input the price you paid for the investment (purchase price) and the price at which you sold it (sale price). The difference between these determines your capital gain or loss.
Choose short-term (held less than one year) or long-term (held more than one year). This is critical because short-term gains are taxed at ordinary income rates while long-term gains enjoy preferential rates.
Include any additional costs that increase your cost basis, such as improvements to a property, brokerage commissions, or transaction fees. These reduce your taxable gain.
Input your annual income from other sources (salary, wages, etc.). For long-term gains, your other income determines which preferential rate (0%, 15%, or 20%) applies to your capital gains.
View your estimated capital gains tax, the comparison between short-term and long-term tax treatment, and the potential tax savings from holding investments longer than one year.
As a single filer with $80,000 in other income, your $30,000 gain falls in the 15% long-term capital gains bracket. The tax is $4,500 instead of approximately $6,600 if it were short-term – a savings of $2,100.
Short-term capital gains from crypto trading are taxed as ordinary income. Your $8,000 gain pushes into the 22% bracket, resulting in $1,760 in federal tax. Holding crypto for over a year could reduce this rate to 15% or even 0%.
As a single filer with $35,000 in other income plus $10,000 in long-term gains, your total taxable income is $45,000, which falls below the 0% capital gains threshold of $47,025. You owe zero federal tax on this gain!
Short-term capital gains apply to investments held for one year or less and are taxed at your ordinary income tax rates (10% to 37%). Long-term capital gains apply to investments held for more than one year and are taxed at preferential rates of 0%, 15%, or 20%, depending on your taxable income. This is one of the most significant tax advantages available to investors. The difference between the two can be substantial: if you are in the 22% ordinary income bracket, holding an asset for just over a year instead of selling it at 11 months could reduce your tax rate on the gain from 22% to 15%.
Capital gains tax is one of the most important tax considerations for investors in the United States. Whether you are trading stocks, investing in cryptocurrency, selling real estate, or managing a diversified investment portfolio, understanding how capital gains are taxed can save you thousands of dollars and help you make more informed investment decisions. The US tax code provides a significant advantage for patient investors through preferential long-term capital gains rates, making the distinction between short-term and long-term holdings one of the most impactful tax planning strategies available to individual investors. Anyone who buys and sells assets — from individual stocks and ETFs to rental properties and digital currencies — needs to understand these rules to maximize their after-tax returns and avoid costly surprises at tax time.
Capital gains tax is calculated on the profit you make when you sell an investment for more than you paid for it — not on the full sale price. The formula is straightforward: Capital Gain equals Sale Price minus Adjusted Cost Basis. Your cost basis is what you originally paid for the asset, and it can be increased by certain expenses such as brokerage commissions, improvement costs for real estate, and transaction fees. For example, if you bought shares for $10,000, paid $100 in commissions, and sold them for $18,000, your adjusted cost basis is $10,100, your capital gain is $7,900, and tax is owed only on that $7,900 gain — not on the full $18,000 sale price. The tax rate applied to your gain depends on your holding period (how long you owned the asset) and your taxable income level, which is determined after applying the 2024 standard deduction of $14,600 for single filers or $29,200 for married filing jointly. The 2024 US tax brackets for ordinary income range from 10% to 37%, and these brackets directly apply to short-term capital gains.
It is equally important to understand what happens when you sell at a loss. If your sale price is lower than your adjusted cost basis, you realize a capital loss. Capital losses can be used to offset capital gains dollar-for-dollar, and if your losses exceed your gains, you can deduct up to $3,000 per year ($1,500 for married filing separately) against your ordinary income. Any unused losses carry forward indefinitely to future tax years. This ability to harvest losses and carry them forward makes tax-loss harvesting one of the most valuable tax strategies available to investors in taxable brokerage accounts, though it does not apply within tax-advantaged accounts like IRAs or 401(k)s.
The most important factor in determining your capital gains tax rate is how long you have held the investment before selling. Investments held for one year or less produce short-term capital gains, which are taxed at your ordinary income tax rate — the same rate that applies to your salary and wages, using the seven US tax brackets ranging from 10% to 37%. This means short-term gains can be taxed at rates as high as 37% for the highest earners. In contrast, investments held for more than one year produce long-term capital gains, which benefit from preferential tax rates of 0%, 15%, or 20% depending on your taxable income level. For example, an investor in the 24% ordinary income bracket who holds a stock for just under a year would pay 24% on the gain. By holding the same stock for just over a year, the rate drops to 15% — a savings of 9 percentage points. On a $50,000 gain, that is a difference of $4,500 in taxes owed, purely from waiting a few extra weeks or months to cross the one-year threshold.
The 0% long-term rate is perhaps the most underutilized tax benefit in the entire US tax code. For 2024, single filers with taxable income up to $47,025 (or $94,050 for married filing jointly) pay absolutely zero federal tax on long-term capital gains. This means that low-to-moderate income earners — including early retirees, students, and those taking a sabbatical year — can realize substantial investment gains completely tax-free, provided they hold their investments for more than one year. The middle bracket at 15% covers most middle-class and upper-middle-class investors with income up to $518,900 for single filers and $583,750 for married filing jointly. Only the highest earners, with income above those thresholds, pay the top rate of 20%, and they may also face the additional 3.8% Net Investment Income Tax (NIIT), pushing their effective top rate to 23.8%.
💡 Pro Tip
Before selling a profitable investment, check whether your total taxable income falls below the 0% long-term capital gains threshold ($47,025 for single filers or $94,050 for married filing jointly in 2024). If you are close, you may be able to realize gains completely tax-free by selling in a year when your income is lower — such as during a gap in employment, a sabbatical, between jobs, or in early retirement before Social Security and required minimum distributions begin.
Long-term capital gains rates are tied to your taxable income, not the size of the gain itself, which is a crucial distinction that many investors misunderstand. For 2024, single filers with taxable income up to $47,025 (or $94,050 for married filing jointly) pay 0% on long-term capital gains. This means that even investors with substantial portfolios can realize gains completely tax-free if their overall taxable income remains below the threshold. The middle bracket, at 15%, covers the vast majority of middle-class and upper-middle-class investors, applying to income up to $518,900 for single filers and $583,750 for married filing jointly. Only the highest earners, with income above those thresholds, pay the top rate of 20%. When combined with the standard deduction of $14,600 (single) or $29,200 (MFJ), these thresholds mean that a married couple with $120,000 in total income and $30,000 in long-term gains could pay just 15% on the gains — a rate far lower than most people assume. These preferential rates represent one of the most powerful tax advantages available to everyday investors and form the foundation of buy-and-hold investment strategies recommended by financial advisors.
Tax-loss harvesting is a strategy where you sell investments that have declined in value to realize a capital loss, which can then be used to offset capital gains and reduce your overall tax liability. If your losses exceed your gains, you can deduct up to $3,000 per year ($1,500 for married filing separately) against ordinary income, and carry forward any unused losses to future years indefinitely. For example, if you have $20,000 in gains and $15,000 in losses, your net taxable gain is only $5,000. If you have $20,000 in gains and $25,000 in losses, you can offset all $20,000 in gains plus deduct $3,000 against ordinary income, and carry forward the remaining $2,000 in losses. This strategy is especially valuable in taxable brokerage accounts (it does not apply to tax-advantaged accounts like IRAs or 401(k)s where gains are already tax-sheltered). The key rule to remember is the wash-sale rule: if you sell a security at a loss and buy a substantially identical security within 30 days before or after the sale, the loss is disallowed for tax purposes. Many modern brokerages offer automated tax-loss harvesting tools to help investors execute this strategy systematically throughout the year.
The Capital Gains Tax Calculator is specifically designed for investors who want to estimate the tax impact of selling an investment. It compares short-term and long-term treatment side by side and factors in the NIIT for high earners, giving you a clear picture of the tax savings from holding longer. For a broader picture of your overall federal tax situation including ordinary income and credits, use the Federal Tax Calculator. If you are self-employed and have both business income and investment gains, combine this calculator with the Self-Employment Tax Calculator for a complete picture. To estimate long-term portfolio growth after taxes, the Investment Return Calculator can help model your after-tax returns over time and show how taxes compound against your wealth.
Different types of investments have unique capital gains tax rules that can significantly impact your tax planning. Collectibles (art, coins, wine, stamps, and other tangible assets) are taxed at a maximum rate of 28% regardless of holding period, which is higher than the 15% rate most investors pay on stocks held long-term. Real estate benefits from the primary residence exclusion, which allows you to exclude up to $250,000 of gain ($500,000 for married filing jointly) provided you owned and lived in the home for at least two of the five years before the sale. Investment properties that do not qualify for the exclusion can defer gains indefinitely through 1031 exchanges, which allow you to reinvest proceeds into similar properties without triggering tax. Cryptocurrency is treated as property for tax purposes by the IRS, meaning every trade, swap, or use to purchase goods is potentially a taxable event — making it one of the most complex asset classes to manage from a tax perspective. Qualified small business stock (Section 1202) may allow you to exclude up to $10 million of gain if held for more than five years, providing a powerful incentive for early-stage investors. Understanding these nuances can help you structure your investment strategy to minimize taxes and maximize after-tax returns over the long term.
Disclaimer: All calculations are estimates based on current tax rules and regulations. Actual values may vary depending on your specific circumstances. Please consult a certified financial advisor or CPA for personalized advice.