How to calculate capital gains tax on the sale of an asset.
Subtract adjusted cost basis from net sale proceeds, determine the holding period, apply the matching rate, then check whether the net investment income tax applies.
To calculate capital gains tax on a sale, subtract the adjusted cost basis from the net sale proceeds to find the gain, determine whether the holding period was one year or less, apply the short term or long term rate accordingly, and then check whether the 3.8 percent net investment income tax applies on top. Four steps, in that order. The capital gains tax calculator handles the rate brackets and the surtax test if you want the figure immediately.
The reason a sale surprises clients is rarely the headline rate. It is that the gain stacks on top of other income, changes the bracket the gain itself falls into, and can trigger a surtax and a Medicare premium increase that nobody quoted them.
Step one: establish the adjusted basis
Basis starts at what was paid and rarely stays there. Add acquisition costs, commissions, and capital improvements. Subtract depreciation previously taken, which matters heavily on rental property, where the depreciation recapture portion is taxed at a different rate than the remaining gain.
Two basis situations to flag early. Inherited assets generally receive a stepped-up basis to fair market value at the date of death, which can erase decades of embedded gain. Gifted assets generally carry over the donor's basis, which can hand the recipient a large unrealized gain along with the gift. Confusing the two is a common and expensive error.
Step two: determine the holding period
Held one year or less, the gain is short term and taxed at ordinary income rates, the same as wages. Held more than one year, it is long term and taxed at the preferential rates of zero, fifteen, or twenty percent depending on taxable income. The one-year line is measured from the day after acquisition. A sale a few days early can be the difference between a fifteen percent rate and a rate more than twice that.
A client who sells eleven months in is often paying a premium of ten to twenty percentage points for the privilege of not waiting four weeks.
Step three: apply the rate to the stacked income
Long term rates are not applied to the gain in isolation. The gain sits on top of ordinary income, and the bracket boundaries are measured against total taxable income. A retiree with modest ordinary income may have part of a gain taxed at zero percent and the remainder at fifteen. A single large sale can push a client from the fifteen percent tier into twenty percent partway through the gain.
This is also why splitting a sale across two tax years can be worth modeling. If the gain straddles a bracket boundary, realizing part of it in December and part in January may keep both halves in the lower tier. Run the client's ordinary income through the tax bracket calculator first so you know where the boundary sits.
Step four: check the net investment income tax
The net investment income tax adds 3.8 percent on the lesser of net investment income or the excess of modified adjusted gross income over the statutory threshold. It applies to capital gains, dividends, interest, rents, and royalties. Because the thresholds are not indexed, more clients cross them every year, and a one-time sale frequently pushes a household over for a single year.
The practical effect is that the real marginal rate on a large long term gain for a high-income household is often 23.8 percent rather than twenty, plus state tax where applicable.
The second-order effects
- Medicare premiums. A gain raises modified adjusted gross income, and IRMAA looks back two years. Check exposure with the IRMAA calculator.
- Social Security taxation. Higher income can increase the taxable portion of benefits, an indirect cost that never appears on the trade confirmation.
- Loss harvesting. Losses offset gains of the same character first, then the other character, with a limited amount of net loss usable against ordinary income and the remainder carried forward.
- Estimated payments. A large gain can create an underpayment penalty if withholding is not adjusted during the year of the sale.
Common questions
What is the difference between short term and long term capital gains?
An asset held one year or less produces a short term gain taxed at ordinary income rates. Held more than one year, it produces a long term gain taxed at preferential rates.
What is the net investment income tax?
It is an additional 3.8 percent surtax on the lesser of net investment income or the amount by which modified adjusted gross income exceeds a statutory threshold.
Can capital losses offset capital gains?
Yes. Losses offset gains of the same character first, then the other character, and a limited amount of remaining net loss can offset ordinary income with the excess carried forward.
Does a home sale qualify for an exclusion?
A primary residence meeting the ownership and use tests can exclude a substantial amount of gain, with a larger exclusion for a married couple filing jointly. Gain above the exclusion is taxable.
Estimate the liability in the capital gains tax calculator, and contact us if a client sale needs a coordinated plan.
Written for licensed life and annuity producers. This article is educational and is not financial, tax, or legal advice. Confirm current figures and client-specific outcomes with a qualified tax professional.
- Medicare and tax
IRMAA planning strategies for retiring clients
IRMAA is a cliff, not a curve. One dollar over a threshold can cost a couple thousands across a year of Medicare premiums. Here is how to plan around it.
- Tax planning
When a Roth conversion actually makes sense
A Roth conversion only wins when the rate paid today is lower than the rate avoided later. Everything else is a detail on top of that one comparison.
- Retirement distributions
RMD mistakes advisors should watch for with clients
Most RMD errors are not calculation errors. They are aggregation errors, timing errors, and inherited-account errors, and they are all preventable.