Calculators.Life Calculator
Tax Accounting

Stock Tax Calculator

Input Parameters

Scenarios
$
The total amount you paid to buy the shares, including brokerage fees.
$
The total gross proceeds from selling the shares.
Assets held for more than one year qualify for preferential federal capital gains tax rates.
$
Your estimated annual taxable income excluding this stock sale.
Your federal tax filing status for the tax year.
%
Your local state capital gains tax rate (0% for states like AK, FL, NV, SD, TN, TX, WY).

Computed Results

Total Capital Gains Tax
$375.00
Net Capital Gain$2,500.00
Effective Tax Rate15%
Federal Capital Gains Tax$375.00
State & Local Tax$0.00
Net Proceeds After Tax$12,125.00
Estimated Tax if Held ≤ 1 Year$550.00
Long-Term Holding Tax Savings$175.00

This stock tax calculator estimates the federal and state capital gains taxes owed when you sell shares for a profit. By evaluating your purchase price, sale price, holding period, and income, it helps you determine your net proceeds and compare the tax impact of short-term versus long-term investments.

This calculator provides mathematical estimates for informational purposes only and does not constitute professional tax advice.

Practical Use Cases

Understanding the tax implications of a stock sale is a critical part of managing an investment portfolio. Investors use this calculator to estimate their tax liability before executing a trade, allowing them to project their actual net proceeds. It is particularly useful for comparing the tax differences between selling a stock just before or just after the one-year mark, as holding an asset long-term generally unlocks lower federal tax rates. Additionally, high-income earners can use it to estimate the impact of the Net Investment Income Tax (NIIT) on their overall capital gains.

Formula & Calculation Method

The calculator determines your tax liability by first calculating the gross capital gain, then applying the relevant federal and state tax rates based on your income, filing status, and holding period.

1. Capital Gain

The taxable profit is the difference between the sale proceeds and the cost basis.

Capital Gain = Sale Price − Purchase Price

2. State Tax

State capital gains taxes are generally calculated as a flat percentage of the total gain.

State Tax = Capital Gain × State & Local Tax Rate

3. Federal Tax & NIIT

Federal taxes depend on how long you held the stock:

If your combined income and capital gain exceed specific federal thresholds (e.g., $200,000 for Single filers or $250,000 for Married Filing Jointly), a 3.8% Net Investment Income Tax (NIIT) is applied to the lesser of your capital gain or the amount your income exceeds the threshold.

Total Tax = Federal Tax + NIIT + State Tax

Verified Scenario Walkthroughs

The following examples demonstrate how different holding periods, income levels, and filing statuses impact the final tax calculation.

Entry Level Short-Term Trade

A single filer with an annual income of $25,000 buys stock for $5,000 and sells it for $6,000 within a year (short-term). The state tax rate is 0%.

High Income Long-Term Investment

A married couple filing jointly with an annual income of $300,000 buys stock for $500,000 and sells it for $750,000 after holding it for several years (long-term). Their state tax rate is 5.5%.

Head of Household Moderate Gain

A head of household with a $65,000 annual income buys stock for $20,000 and sells it for $25,000 after more than a year. The state tax rate is 3.0%.

Married Filing Separately Break-Even

An investor filing separately with a $150,000 income buys stock for $100,000 and sells it for exactly $100,000. The state tax rate is 8.0%.

How to Use the Calculator

Follow these steps to estimate your stock taxes:

  1. Purchase Price (Cost Basis): Enter the total amount paid for the shares, including any brokerage fees.
  2. Sale Price: Enter the total gross proceeds from the sale.
  3. Length of Ownership: Select whether you held the stock for more than one year (long) or one year or less (short).
  4. Annual Taxable Income: Input your estimated taxable income for the year, excluding the profit from this specific stock sale.
  5. Filing Status: Choose your federal tax filing status (Single, Married Filing Jointly, Married Filing Separately, or Head of Household).
  6. State & Local Tax Rate: Enter your local state capital gains tax rate as a percentage.

Inputs & Outputs Reference

CategoryField NameDescription
InputPurchase Price (Cost Basis)The total amount you paid to buy the shares, including brokerage fees.
InputSale PriceThe total gross proceeds from selling the shares.
InputLength of OwnershipAssets held for more than one year qualify for preferential federal capital gains tax rates.
InputAnnual Taxable IncomeYour estimated annual taxable income excluding this stock sale.
InputFiling StatusYour federal tax filing status for the tax year.
InputState & Local Tax RateYour local state capital gains tax rate (0% for states like AK, FL, NV, SD, TN, TX, WY).
OutputTotal Capital Gains TaxThe combined total of your estimated federal and state taxes.
OutputNet Capital GainThe total profit from the sale before taxes are applied.
OutputEffective Tax RateThe total tax divided by the capital gain, expressed as a percentage.
OutputFederal Capital Gains TaxThe estimated federal tax owed, including the Net Investment Income Tax if applicable.
OutputState & Local TaxThe estimated state tax owed based on your provided rate.
OutputNet Proceeds After TaxThe final amount you keep after subtracting the initial purchase price and all estimated taxes.
OutputEstimated Tax if Held ≤ 1 YearThe projected tax liability if the asset was sold as a short-term investment.
OutputLong-Term Holding Tax SavingsThe estimated amount saved by holding the asset for more than one year.

Frequently Asked Questions

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

Short-term capital gains apply to assets held for one year or less and are taxed at your standard ordinary income tax rates. Long-term capital gains apply to assets held for more than one year and are taxed at lower, preferential federal rates (typically 0%, 15%, or 20%).

Does this calculator include the Net Investment Income Tax (NIIT)?

Yes, the calculator automatically applies the 3.8% Net Investment Income Tax (NIIT) to your capital gains if your combined income and gain exceed the federal threshold for your selected filing status.

How do I find my state capital gains tax rate?

State capital gains tax rates vary by location. Some states have no income tax (like Florida and Texas), while others tax capital gains at their standard state income tax rates. You can find your specific rate by checking your state's Department of Revenue website.

Author portrait
About the Author
Arnab Biswas

Calculator developer and SEO strategist who builds practical online calculators and tests calculation logic, input handling, and expected results using real-world scenarios.