How much capital gains tax to sell stock to buy a house in cash with low basis?

Trying to figure out how much capital gains tax to sell stock to buy a house in cash with low basis before I pull the trigger on this. I have about $180k in a brokerage account, mostly shares I've held for years with a very low cost basis — bought some of it over a decade ago and barely touched it. I want to sell everything and use the proceeds as a cash offer on a house. I ran some rough numbers but I'm not sure if I'm accounting for state taxes, the net investment income tax, or whether my income level even matters here. Already looked at Schedule D and Form 8949 but I'm not sure how to estimate what I'll actually owe before I sell. What should I expect and what do I actually need to calculate this correctly?

32 comments

The federal rate that applies to your long-term gain depends on your taxable income in the year you sell — it's not a flat number. You need to know where your total income for the year lands relative to the thresholds in the Schedule D instructions. The IRS Qualified Dividends and Capital Gain Tax Worksheet inside those instructions walks through exactly how the rate is determined. Start there before you estimate anything.

Eric V.

Author

Thanks, I'll pull up the Schedule D instructions. I didn't realize my ordinary income level affects which rate kicks in for the long-term gains.

Low basis is the key phrase here. Your taxable gain is proceeds minus your adjusted cost basis, reported on Form 8949 and carried to Schedule D. If you've held all these shares more than one year, every dollar of gain is long-term. The holding period starts the day after your trade date and ends on your trade date when you sell — not settlement date. That matters if any position is close to the one-year mark.

Eric V.

Author

All of these have been held way more than a year, some over 10 years. So all long-term. Good to know the trade date rule though.

Worth double-checking each lot individually if you've added shares over time. Reinvested dividends create new lots with their own dates and basis.

I uploaded my brokerage year-end statement and my draft 8949 to taxr.ai and it walked through each lot — identified which ones had the lowest basis relative to proceeds and flagged two positions I had the holding period wrong on. Really useful before you commit to selling everything. On the federal side: for long-term gains you need that Qualified Dividends and Capital Gain Tax Worksheet. And don't forget the 3.8% net investment income tax if your modified adjusted gross income clears the threshold — the instructions for Form 8960 tell you exactly where the cutoff is for your filing status.

Eric V.

Author

The 8960 is something I hadn't looked at yet. I'll check that threshold before I decide how much to sell.

The NIIT catches a lot of people who do a one-time large sale like this because the gain pushes MAGI over the line even if their wages alone wouldn't.

State tax is a separate calculation and varies a lot. Some states tax long-term gains the same as ordinary income, some have a lower rate, a few have none. You need to know your state's rules — your state revenue department's site is the place to look. This can add several percentage points on top of the federal bill and is easy to underestimate.

Eric V.

Author

Good point. I'll check my state's rules separately. I'd been thinking only about federal.

One thing that doesn't apply here: the home sale exclusion. That exclusion is for gain on the sale of your home, not for gains you use to buy one. You can't shelter the stock gain just because you're buying a house with the proceeds. I see that confusion come up a lot.

If you're doing this in a single tax year, the entire gain hits your return all at once. That can push your effective rate higher than you'd expect because of how the stacking works with ordinary income. The worksheet in the Schedule D instructions shows the stacking order. Run the numbers with your projected wages or other income included, not just the gain in isolation.

Eric V.

Author

This is exactly the kind of thing I was worried about missing. I'll model the whole year's income together.

To actually calculate it: take your expected proceeds for each lot, subtract the adjusted cost basis per share times shares sold, sum the long-term gains across all lots, then run the tax worksheet. The 1099-B your broker sends in January will have the basis for covered securities. For older shares it may show basis as unknown — in that case you need your own records to fill in column (e) on Form 8949.

Selling everything in one year vs. spreading across two years if the timing works is worth modeling. If your gain is large enough, splitting the sale across December and January keeps two years' worth of income separate and might keep you below an NIIT or rate threshold in each year. Depends entirely on your numbers and when you need the cash for the purchase.

This is real. December 31 vs January 2 trade dates put the gain in completely different tax years. If the house purchase isn't immediate, the timing flexibility has value.

Eric V.

Author

The house I'm looking at might not close until spring so I might actually have that flexibility. I'll look at whether splitting it makes a difference.

I had a similar situation last year — sold a large long-term position to fund a purchase. I ran my 1099-B through Taxr and it mapped every lot to the right row on Form 8949, flagged the ones where my broker had basis marked as not reported to IRS, and gave me a tally of the total gain before I filed. Helped me see the full picture before anything was locked in. On substance: check whether any of your lots have a wash sale code from prior years adjusting the basis upward. If you sold at a loss and bought back within 30 days in the past, that disallowed loss was added to your basis — it lowers your gain now when you finally sell for good.

Eric V.

Author

I think I did have a wash sale situation about two years ago. I'll dig up those records and check if the basis was adjusted properly before I sell.

The effective rate ends up being a blended number across the 0%, 15%, and 20% long-term brackets depending on how much ordinary income you already have. The tax worksheet layers the gain on top of ordinary income, so the first dollars of gain that fall in the lower brackets get the lower rate. It's not all taxed at the top rate even if you have a big gain.

Don't overlook estimated tax payments. If you sell mid-year and owe a large amount, you need to pay estimated tax to avoid an underpayment penalty. The Form 2210 instructions explain when the penalty applies and the safe harbor thresholds. If you can cover it through withholding elsewhere, great, but if this is mostly investment income you'll likely need to pay quarterly.

This trips up a lot of people on big one-time sales. The IRS expects tax paid as you earn, not just at filing.

Eric V.

Author

Thanks — I hadn't thought about quarterly payments at all. I'll look at Form 2210 and figure out what I need to send in.

I uploaded my brokerage statement and a rough income projection to Taxr last spring before a large sale. It put together a worksheet showing my estimated gain by lot, the stacking with my W-2 income, and what portion would hit the NIIT threshold. That let me decide how many shares to sell before year end. Practically: your total federal exposure is the long-term gain times the applicable rate from the tax worksheet, plus any NIIT on the amount above the Form 8960 threshold, plus state. Add all three for a realistic pre-sale estimate.

Eric V.

Author

Breaking it into those three buckets is really helpful. Federal rate layer, NIIT layer, then state on top. That gives me a framework to actually model it.

If the basis really is very low — like near zero — your gain is almost equal to the full proceeds. In that case even a 15% federal rate on a large sale is a big number. Sometimes people are surprised how much cash disappears to taxes. It's worth knowing the exact basis from your records before you assume you'll net the full sale price for the house.

Eric V.

Author

Yeah the basis on some of these is genuinely close to zero. That's exactly why I wanted to understand the tax before committing to a cash offer at a specific price.

Be careful about one thing: gifted shares or inherited shares have different basis rules. Gifted shares carry the donor's adjusted basis (with some exceptions involving gift tax). Inherited shares generally take fair market value at date of death as basis and are automatically long-term regardless of how long you've held them. If any of these positions came to you as a gift or inheritance, your basis calculation is different from what a brokerage statement might show.

The Publication 551 page on irs.gov covers both gift and inherited basis in detail if you need to work through it.

If the amount is large enough that you're not sure you're getting this right, an enrolled agent or CPA who handles investment taxation can run the actual numbers with your full income picture. The interaction between the stacking, NIIT, and state tax is straightforward in concept but easy to calculate wrong, and a mistake in estimating could mean you short yourself on the down payment or face an unexpected tax bill.

Eric V.

Author

That's fair. I might take what I've built in my spreadsheet to a CPA just to sanity-check before I make an offer.

Final practical step: once you know the estimated tax, subtract it from your expected proceeds to get your true available cash for the purchase. Banks and sellers don't wait for your tax refund — you need to make sure the after-tax number still covers the offer price, closing costs, and any reserves your lender or the deal requires.