How to sell appreciated stock and reduce long-term capital gains tax

Trying to figure out the best approach before year end. I've got a taxable brokerage account with positions I've held more than a year, some up significantly. I know they'd be taxed as long-term capital gains but I don't really understand how the rate is determined or what levers I have to pull it down. I've looked at Schedule D and the Qualified Dividends and Capital Gain Tax Worksheet in the 1040 instructions but honestly it's not clicking for me. I'm single, salaried, no other investment income besides a small amount of dividends. I already maxed my 401k. Is there a standard set of moves people use to reduce long-term capital gains tax when selling appreciated stock, or does it really just depend on total income?

35 comments

Have you looked at whether you have any positions currently sitting at a loss? That's the most direct lever most people have. If you sell losers before year end, those losses offset your gains dollar for dollar on Schedule D, and if losses exceed gains the excess goes against ordinary income up to the limit spelled out in Topic no. 409 at irs.gov. Watch the wash sale window though — 30 days before or after the sale, no buying back substantially identical shares.

Chris L.

Author

Yeah I have a couple positions down. Hadn't really thought of harvesting them intentionally. So I'd report both the gain sale and the loss sale on Form 8949, they'd net on Schedule D, and I'd only owe tax on the net?

Exactly. Both go on Form 8949 Part II (long-term, since you've held more than a year), then flow to Schedule D line 8b, 9 or 10 depending on which box you checked. The net is what gets taxed. Just keep the wash sale rule in mind when you decide what to buy back.

Are you using a donor-advised fund or thinking about charitable giving at all? I had a pile of appreciated shares and donated them directly to a DAF instead of selling. You avoid realizing the gain entirely and get a charitable deduction for the fair market value. I ran the numbers on my own shares through taxr.ai and it modeled the difference between selling and donating — that worksheet made the choice really obvious for me. Deductibility limits depend on your AGI so check Publication 526 for the specifics.

Chris L.

Author

Not currently set up with a DAF but that's interesting. So the gain never hits Schedule D at all if I donate the shares directly?

Right — if you transfer the shares in-kind to the charity or DAF before selling, the gain isn't your income event to report. The charity sells. You get the deduction. AGI-based limits apply, pub 526 has the detail.

What's your rough total income picture looking like this year? The rate on long-term gains isn't fixed — it depends where your taxable income lands on the Qualified Dividends and Capital Gain Tax Worksheet. At lower income levels the rate can actually be zero, so sometimes it makes sense to realize gains deliberately if you expect higher income next year.

Chris L.

Author

I haven't run the full projection yet. I see what you're saying though — if I'm near the top of a lower bracket it matters a lot whether I realize gains this year vs next.

The holding period question is worth double-checking before you sell anything. For securities traded on an exchange, the holding period starts the day after your trade date and ends on the day you sell (trade date, not settlement). IRS Publication 550 is explicit that it's trade date to trade date. If anything is close to the one-year mark you want to be sure you're actually in long-term territory before pulling the trigger.

Chris L.

Author

Good point. I had one position I bought almost exactly a year ago and I need to verify the trade date, not when it settled.

Settlement date is a trap. Your brokerage confirms trade date on your statement. Count from the day after the buy trade date — the day you sell counts as a day in the holding period per Publication 550.

Does your employer offer a deferred compensation plan or an HSA you haven't maxed? Pushing more income into pre-tax accounts lowers your AGI, which shifts where you land on that capital gain rate worksheet. That's separate from the gains themselves but it affects what rate applies.

Chris L.

Author

HSA is a good thought — I'm on a high-deductible plan and haven't maxed it this year. That could help. I'll check the contribution limit in the HSA instructions.

Something worth knowing: if you transfer appreciated stock to a family member in a lower income bracket as a gift, they'd sell it and potentially owe little or nothing in capital gains depending on their income. But basis carries over from you to them — they'd use your adjusted basis for calculating their gain. See Publication 551 for the gifted property basis rules. Kiddie tax rules can complicate this for minors.

Chris L.

Author

Yeah I've heard about kiddie tax. The person I'd consider gifting to is an adult so that wouldn't apply, but good to flag for others reading this.

Are you in a state with its own capital gains tax? Because all these federal strategies don't necessarily reduce what your state takes. Some states tax long-term and short-term the same and don't follow federal exclusions. Worth running the state side of this separately.

I want to revisit the loss harvesting point from earlier. The wash sale rule catches more people than they expect. It's not just buying the same ticker back — if your spouse buys substantially identical shares in that 30-day window, or if you pick them up inside an IRA or Roth IRA, the loss is still disallowed. And unlike the regular wash sale where the disallowed loss adds to your basis in the new shares, the IRA version doesn't give you that basis rescue. I had Taxr read through my year-end trade log and brokerage statement side by side and it flagged two trades I had no idea were wash sales because my wife had bought the same ETF in her Roth. That would have been a mess on Form 8949.

Chris L.

Author

Wait, the IRA exception is real? So if I sell at a loss in my taxable account and buy the same fund in my IRA, the loss is gone and I don't even get to add it to my IRA basis?

Correct. Publication 550 is clear on this — the disallowed loss doesn't add to the IRA's basis when the IRA bought the substantially identical shares. That's the worst outcome because the loss just disappears entirely. Code W on Form 8949 column (f), loss not allowed in column (g), and you get nothing back.

Has anyone here done the installment sale route? If you're selling a large block and the buyer is a private party (not publicly traded stock), you might spread recognition over multiple years. Doesn't apply to publicly traded securities sold on an exchange though — those don't qualify for installment treatment.

Installment sale — worth noting it's off the table for exchange-traded stocks, which is what this thread is about. The poster has brokerage account shares.

Chris L.

Author

Yeah, all exchange-traded. Good to know the distinction though.

Opportunity Zone funds come up in these conversations sometimes. You can defer and potentially reduce capital gains by rolling proceeds into a Qualified Opportunity Zone fund within a certain window. These are complex, the rules have changed, and I'd strongly suggest an enrolled agent or CPA who specializes in these before going that route. It's not a DIY move.

Going back to the charitable giving angle — I actually had a year where I did a combination: harvested losses to offset part of the gain, donated the most appreciated shares directly to a DAF, and sold the rest. I gave Taxr my brokerage statements and the draft Schedule D and it built out a comparison showing what each lot's net tax cost would be under each scenario — which to sell, which to donate, which to hold. Saved me a lot of spreadsheet work. The underlying math still runs through Form 8949 and Schedule D the normal way, it just helped me see which combination was cheapest before I executed any trades.

Chris L.

Author

This is actually the approach I think I need — running the scenarios before I sell anything so I know the order to execute. I didn't realize you could get that kind of lot-level detail without a full financial planner.

Don't overlook specific identification of lots when you sell. If your broker lets you designate which specific shares you're selling, you can pick the highest-basis lots first to minimize the gain. If you don't elect specific ID your broker defaults to some method (often FIFO) and you can't go back and change it after the trade. Tell your broker before you execute which lots you're selling.

Chris L.

Author

My broker does support specific lot selection. I didn't realize not electing it before the trade locked you in. That's actually the most actionable thing in this thread for me right now.

Lot selection — do it before you hit confirm on the order. Once the trade executes under the default method that's your basis. Publication 550 covers the specific identification rules under "Cost Basis."

Is there a reason you need to sell this year specifically? Holding another year doesn't change the rate category since you're already long-term, but if you expect your income to drop (retirement, leave, whatever) next year the same shares sold at the same price could be taxed at a lower rate just because your total income is lower.

Chris L.

Author

Honestly no hard deadline. I was partly just nervous about the positions being so concentrated. Timing it around income level makes sense as a framework.

Worth mentioning: the net investment income tax applies to investment income above a modified AGI threshold for certain filers. It's separate from the capital gains rate and stacks on top of it. The threshold and rate are in the Form 8960 instructions — just know it exists so you're not surprised when the total effective rate on the gain is higher than you expected.

Net investment income tax — yes, this is the one that bites people who don't see it coming. Form 8960 is a one-pager but it can add meaningfully to what you owe on a large gain.

Has anyone mentioned Roth conversions in the context of this? If your capital gains push you into a year where your ordinary income is otherwise low, the same low-income year that might have a favorable gains rate could also be a window for converting traditional IRA funds. They're separate calculations but sometimes the same circumstances favor both moves. A CPA can model the interaction.

To bring it all together for the poster: the main levers are (1) loss harvesting on Form 8949 to net against gains, (2) specific lot identification before you trade, (3) direct charitable giving of appreciated shares to avoid the gain event, (4) lowering AGI through pre-tax contributions to shift your rate on the capital gain worksheet, and (5) timing the sale across tax years if your income varies. All of these interact with each other and your state return. If you're dealing with a large gain, running this by a CPA or enrolled agent before year end is worth the cost — the strategies are real but the interaction effects can get complicated.

Chris L.

Author

This is a solid summary. I'm going to run my specific lots and loss positions through a scenario model before doing anything. Thanks everyone — this gave me a real roadmap instead of just vague advice about "tax-loss harvesting."