Stock Tax Calculator
Input Parameters
Computed Results
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.
2. State Tax
State capital gains taxes are generally calculated as a flat percentage of the total gain.
3. Federal Tax & NIIT
Federal taxes depend on how long you held the stock:
- Short-Term (1 year or less): Taxed at standard ordinary income tax brackets.
- Long-Term (More than 1 year): Taxed at preferential capital gains rates (0%, 15%, or 20%) based on your taxable income.
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.
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%.
- Capital Gain: $1,000
- Federal Tax: $120
- Total Tax: $120
- Net Proceeds After Tax: $5,880
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%.
- Capital Gain: $250,000
- Federal Tax (including NIIT): $47,000
- State Tax: $13,750
- Total Tax: $60,750
- Net Proceeds After Tax: $689,250
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%.
- Capital Gain: $5,000
- Federal Tax: $750
- State Tax: $150
- Total Tax: $900
- Net Proceeds After Tax: $24,100
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%.
- Capital Gain: $0
- Total Tax: $0
- Net Proceeds After Tax: $100,000
How to Use the Calculator
Follow these steps to estimate your stock taxes:
- Purchase Price (Cost Basis): Enter the total amount paid for the shares, including any brokerage fees.
- Sale Price: Enter the total gross proceeds from the sale.
- Length of Ownership: Select whether you held the stock for more than one year (long) or one year or less (short).
- Annual Taxable Income: Input your estimated taxable income for the year, excluding the profit from this specific stock sale.
- Filing Status: Choose your federal tax filing status (Single, Married Filing Jointly, Married Filing Separately, or Head of Household).
- State & Local Tax Rate: Enter your local state capital gains tax rate as a percentage.
Inputs & Outputs Reference
| Category | Field Name | Description |
|---|---|---|
| Input | Purchase Price (Cost Basis) | The total amount you paid to buy the shares, including brokerage fees. |
| Input | Sale Price | The total gross proceeds from selling the shares. |
| Input | Length of Ownership | Assets held for more than one year qualify for preferential federal capital gains tax rates. |
| Input | Annual Taxable Income | Your estimated annual taxable income excluding this stock sale. |
| Input | Filing Status | Your federal tax filing status for the tax year. |
| Input | State & Local Tax Rate | Your local state capital gains tax rate (0% for states like AK, FL, NV, SD, TN, TX, WY). |
| Output | Total Capital Gains Tax | The combined total of your estimated federal and state taxes. |
| Output | Net Capital Gain | The total profit from the sale before taxes are applied. |
| Output | Effective Tax Rate | The total tax divided by the capital gain, expressed as a percentage. |
| Output | Federal Capital Gains Tax | The estimated federal tax owed, including the Net Investment Income Tax if applicable. |
| Output | State & Local Tax | The estimated state tax owed based on your provided rate. |
| Output | Net Proceeds After Tax | The final amount you keep after subtracting the initial purchase price and all estimated taxes. |
| Output | Estimated Tax if Held ≤ 1 Year | The projected tax liability if the asset was sold as a short-term investment. |
| Output | Long-Term Holding Tax Savings | The 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.