How to Optimize the 0% Capital Gains Tax Bracket (With a Free Spreadsheet)
- Gin

- Dec 19, 2025
- 8 min read

I’m so excited to share a new spreadsheet I recently created to estimate tax liability and optimize long-term capital gains (LTCG)!
I know this sounds like an odd thing to get excited about—but hear me out.
Since retiring earlier this year, early retirement tax planning has become a major focus for us. We have more than a decade before we begin to collect Social Security. And without steady paychecks, we’ll be relying solely on our savings and investments. Of course, we’d like to keep as much of our money for ourselves. We didn’t work our asses off for Uncle Sam’s sake!
As previously mentioned, one strategy to reduce taxes is to optimize the 0% long-term capital gains tax bracket. It’s possible to pay zero in taxes on long-term capital gains if you’re careful about staying in the 0% bracket.
But how do you calculate how much capital gains you can realize while staying within the 0% bracket?
We’ve covered how our progressive tax system works and how ordinary income and long-term capital gains stack on top of each other. So, it is possible to calculate the amount manually. But boy, is it a pain in the ass to do!
So for the past several months, I’ve been working on a spreadsheet to do the heavy lifting. And I’ve finally come up with one that will do the following:
Estimate ordinary income tax
Estimate long-term capital gains tax
Calculate how much long-term capital gains can be realized at the 0% tax rate
Flag if estimated tax payments will be needed

The spreadsheets can be downloaded for free at the bottom of this post.
But first, an explanation of how it works, section by section.
ESTIMATED TAX LIABILITY AND LTCG OPTIMIZATION SHEET OVERVIEW
Note: This spreadsheet only calculates federal tax and assumes no taxes have been withheld from any ordinary income. For simplification, it only uses the standard deduction and does not take into account any other deductions or credits.

Ordinary Income: Enter the total of your ordinary income, which includes, but is not limited to, earned wages, interest from savings and CDs, ordinary dividends, money from side businesses, and gambling winnings. Include any short-term capital gains here as well, since they are taxed at the same rates as ordinary income. Remember, short-term capital gains come from selling stocks held for one year or less.
Realized Capital Gains/Dividends: Enter the total of long-term capital gains and qualified dividends.
The above two are the only pieces of information you’ll need to enter for the spreadsheet to work.
Standard Deduction: The standard deduction for the tax year is pre-populated and differs for Married Filing Jointly or Single Filer. This amount reduces your taxable income and is deducted from your ordinary income first, then long-term capital gains.
ORDINARY INCOME TAX BRACKETS
This section shows how your taxable ordinary income is allocated across each federal tax bracket and how much tax is owed at each level.

Each tax bracket for ordinary income is listed by row and includes the following:
Min Income and Max Income: Income threshold for each tax bracket. Remember, only the portion of your income that falls within each bracket is taxed at that bracket’s rate.
Tax Rate: Marginal tax rates for each bracket.
Bracket Width: Shows how much of your income fits within each bracket before overflowing into the next highest bracket.
Income Allocated: Amount of your taxable ordinary income that falls within each bracket and will be taxed at that bracket’s rate.
Tax for Bracket: Actual amount of taxes owed for that tax bracket.
LONG-TERM CAPITAL GAIN TAX BRACKETS
This section shows how long-term capital gains are layered on top of ordinary income and how much of the 0% capital gains bracket is still available.

Tax brackets for long-term capital gains follow a similar format to ordinary income tax brackets, with one exception.
Remaining Space in Bracket: Shows how much capital gains can still fit within the bracket. Due to the stacking principle, this value can change according to how much ordinary income is being accounted for.
TAX SUMMARY
This section pulls everything together, showing your total taxable income, estimated federal tax liability, and how much room remains in the 0% capital gains bracket.

Adjusted Gross Income (AGI): Sum of the Ordinary Income and Long-Term Capital Gains you input at the top of the spreadsheet.
Total Taxable Income: AGI minus the standard deduction. Taxable Income is what falls into the above tax brackets.
Ordinary Income Taxable Portion: Portion of your Total Taxable Income that falls into the Ordinary Income tax brackets. The standard deduction reduces your taxable ordinary income first.
Capital Gains Taxable Portion: Portion of your Total Taxable Income that falls into the Long-Term Capital Gains tax brackets. The standard deduction reduces your taxable long-term capital gains only after ordinary income.
Ordinary Income Tax: Sum of the amounts under the Tax for Bracket column in the Ordinary Income tax brackets.
Capital Gains Tax: Sum of the amounts under the Tax for Bracket column in the Long-Term Capital Gains tax brackets.
Total Federal Tax Liability: Estimated total federal tax owed to good ol’ Uncle Sam.
Estimated Tax Flag: If Total Federal Tax Liability is greater than $1,000, estimated tax payments should be made to avoid penalties. Note: This spreadsheet does not take into account any federal taxes withheld from ordinary income, such as paychecks.
Remaining LTCG in 0% Bracket: Shows how much more long-term capital gains can be realized tax-free. This amount changes based on the ordinary income and long-term capital gains amounts entered at the top of the spreadsheet.
The default amount shown is equal to the upper threshold (Max Income) of the 0% bracket. If, however, no ordinary income is entered, once this threshold is reached, this amount will reset to match the standard deduction. This is due to how the standard deduction reduces any ordinary income first and then long-term capital gains.
If that’s too confusing, all you need to understand is this: With zero ordinary income, you can realize the entire 0% long-term capital gains bracket plus the standard deduction tax-free.
In the above screenshot, that would be: $96,700 + $31,500 = $128,200. That’s a lot of tax-free money!
EXAMPLES: SEEING THE 0% CAPITAL GAINS BRACKET IN ACTION
Now let’s take a look at this spreadsheet in action with actual numbers. You’ll see how the ordinary income and capital gains fill their respective tax brackets.
EXAMPLE 1: $60K ORDINARY INCOME AND $40K CAPITAL GAINS

Ordinary Income Taxable Portion near the bottom of the spreadsheet shows that of the $60,000 ordinary income, only $28,500 is taxable. This is due to the $31,500 standard deduction, which always reduces ordinary income first.
Of that $28,500, we can see that the first $23,850 falls within the 10% tax bracket, and the remaining $4,650 falls within the 12% bracket.

Ordinary income tax for each bracket
10%: $2,385
12%: $558
Total ordinary income tax: $2,943
In the 0% long-term capital gains tax bracket, notice that there’s only $68,200 remaining space in the bracket instead of $96,700. This is due to the stacking principle of how capital gains are taxed. Ordinary income reduces the available space in the bracket.
In this example, we have $28,500 in taxable ordinary income. So, the available space within the 0% bracket is reduced by that amount.
$96,700 minus $28,500 = $68,200
Fortunately, that’s still more than enough space for the $40,000 in capital gains to fit within. Hence, zero taxes are owed on those capital gains.

Looking at the tax summary, we see that a total of $2,943 is owed in taxes.
$2,943 (ordinary income tax) plus $0 (capital gain tax) = $2,943 total federal tax liability.
Because that amount is more than $1,000, estimated tax payments are needed.
We also see that an additional $28,200 in long-term capital gains can still be realized without paying any additional taxes.
EXAMPLE 2: $20K ORDINARY INCOME AND $80K CAPITAL GAINS
The total of income and capital gains is also $100,000, as in the previous example. The only difference is the mixture of ordinary income and capital gains.

Look at Ordinary Income Taxable Portion and Capital Gains Taxable Portion near the bottom.
Notice that there’s no taxable ordinary income. Remember, the standard deduction reduces ordinary income first. In this example, the $31,500 standard deduction is larger than ordinary income ($20,000), so no taxes are owed on ordinary income.
The remaining $11,500 of the standard deduction then gets applied to long-term capital gains. So, the $80,000 in capital gains is reduced to $68,500. That taxable portion of capital gains falls completely within the 0% capital gains tax bracket.
Also, notice that the remaining space in that bracket is $96,700. Since there was no taxable ordinary income, the full capacity of the bracket is available.

Despite $100,000 being reported like the first example, zero federal taxes are owed! And another $28,200 in capital gains can be realized tax-free!
HOW TO USE THE SPREADSHEET FOR TAX PLANNING
Hopefully, you agree that this spreadsheet is pretty cool.
Feel free to download it and plug in your own numbers. Even if you don’t plan to realize capital gains this year, try playing with the inputs. Watching how ordinary income fills the brackets—and how that affects long-term capital gains—makes the tax system click in a way that articles alone usually don’t.
When you’re ready, use the spreadsheet to estimate how much long-term capital gains you can realize tax-free today. Pair it with strategies like capital gains harvesting or Roth IRA conversions to reduce taxes now and in the future.
FREQUENTLY ASKED QUESTIONS
Is this spreadsheet tax advice? No. This spreadsheet is for educational and planning purposes only. It provides estimates based on current federal tax brackets and simplified assumptions. Always consult a qualified tax professional for advice specific to your situation.
Does this spreadsheet include state taxes? No. The spreadsheet estimates federal taxes only. State taxes vary widely and are not included.
Can I use this spreadsheet if I’m still working? Yes. You can enter wages, interest, dividends, and capital gains to see how they interact. However, the tool is especially useful for early retirees and anyone managing income intentionally.
What filing statuses are supported? Versions are available for Married Filing Jointly and Single filers for the 2025 and 2026 tax years.
Why does ordinary income reduce the 0% capital gains bracket? Because long-term capital gains are stacked on top of ordinary income. Higher ordinary income reduces the amount of capital gains that can fit into the 0% bracket.
DOWNLOAD THE SPREADSHEET
Disclaimer: This spreadsheet is provided for educational and informational purposes only. It is a simplified estimation tool and should not be considered tax advice. Tax laws and individual circumstances vary, and results may not reflect your actual tax liability. Consult a qualified tax professional for advice specific to your situation.
Download the version that matches your platform and tax year.
Each file includes two worksheets:
Married Filing Jointly
Single
Available downloads:
Excel – 2025 tax year
Excel – 2026 tax year
Apple Numbers – 2025 tax year
Apple Numbers – 2026 tax year
Open the worksheet that matches your filing status and enter your numbers at the top, and see exactly how much long-term capital gains you can realize while staying in the 0% bracket.
If you use the spreadsheet—or spot something I can improve—let me know in the comments.
See you at the finish line!
Disclaimer: I’m not a licensed financial professional. This blog shares my personal experiences and opinions around money, investing, and early retirement. It’s for informational and educational purposes only—not financial, legal, or tax advice. Always do your own research or consult with a qualified professional before making any financial decisions.




Comments