taxes calculators

Capital Gains Tax Calculator

Estimate the tax owed when you sell an investment by entering your purchase price, sale price, holding period, and income level. Use it before selling stocks, real estate, or other assets.

About this calculator

Capital gains tax applies to the profit earned from selling a capital asset. The gain is calculated as: Capital Gain = Sale Price − Purchase Price − Sale Expenses. Whether the gain is taxed as short-term or long-term depends on how long you held the asset. Assets held one year or less are short-term gains, taxed as ordinary income (this calculator uses 22% as a representative rate). Assets held longer than one year qualify for preferential long-term rates: 0% for lower-income taxpayers, 15% for middle-income, and 20% for higher-income earners. The tax owed is therefore: Tax = (Sale Price − Purchase Price − Expenses) × Rate. Minimizing taxable gains through timing, tax-loss harvesting, or exemptions (like the primary residence exclusion) can significantly reduce this liability.

How to use

Suppose you bought stock for $10,000, sold it for $15,000, and paid $200 in broker commissions, holding it for 18 months (long-term). Your income level is medium. Step 1: Capital gain = $15,000 − $10,000 − $200 = $4,800. Step 2: Long-term rate for medium income = 15%. Step 3: Tax = $4,800 × 0.15 = $720. If you had sold after only 6 months (short-term), the tax would be $4,800 × 0.22 = $1,056—a $336 difference just from timing.

Frequently asked questions

What is the difference between short-term and long-term capital gains tax rates?

Short-term capital gains apply to assets held one year or less and are taxed at your ordinary income tax rate, which can be as high as 37% for high earners. Long-term capital gains apply to assets held more than one year and are taxed at reduced rates of 0%, 15%, or 20%, depending on your taxable income. This preferential treatment incentivizes long-term investing. Holding an asset just a few extra days past the one-year mark can sometimes save thousands in taxes.

How do sale expenses reduce my capital gains tax liability?

Sale expenses—such as broker commissions, legal fees, and transfer taxes—are subtracted from your proceeds before calculating the gain. This reduces your taxable gain dollar for dollar. For example, $500 in commissions on a long-term sale subject to a 15% rate saves $75 in tax. Keeping detailed records of all transaction costs is important because these deductions are easy to overlook but can meaningfully lower your bill.

When can I exclude capital gains from the sale of my primary residence?

The IRS allows single taxpayers to exclude up to $250,000 in capital gains from the sale of their primary home, and married couples filing jointly can exclude up to $500,000. To qualify, you must have owned and lived in the home as your primary residence for at least two of the five years before the sale. This exclusion does not apply to investment or rental properties. If your gain exceeds the exclusion amount, only the excess is subject to capital gains tax.