Capital gains tax on property sold out of state — do I owe taxes in both states?

Sold a rental property I owned in another state (not my state of residence) earlier this year. Closing attorney withheld a chunk for nonresident withholding, which I expected. What I didn't expect is my tax software is now asking me to report the gain on my resident state return too. I've been entering everything on Form 8949 and Schedule D for federal, and that part seems fine. But I'm confused about whether I actually owe capital gains tax on property sold out of state to both my resident state AND the state where the property was located. I tried reading both states' instructions and got more confused. Will I get a credit somewhere so I'm not taxed twice on the same gain? Or does one state have priority?

38 comments

Yes, you generally owe in both states, but you don't get taxed twice. The state where the property was located has first claim on the gain because real property income is sourced to where the property sits. Your resident state also taxes your worldwide income, but it must give you a credit for taxes paid to the other state. That credit goes on your resident state return and offsets what would otherwise be double taxation. The credit is usually limited to the lesser of what you paid the nonresident state or what your resident state would have charged on that same income.

Sofia S.

Author

So the withholding the closing attorney took — does that count toward the nonresident state tax I paid, for purposes of that credit?

Yes, withholding is a prepayment of that state's tax. When you file the nonresident return you apply it against the tax owed and either get a refund or owe more. The amount you actually owe the nonresident state (not just the withholding) is what feeds the credit on your resident return.

The federal side is straightforward at least. Your gain goes on Form 8949, then carries to Schedule D. If you held the property more than one year, the holding period makes it long-term — and for securities the holding period starts the day after the trade date, but for real property it's the day after you acquired it and ends the day you disposed of it. Long-term vs. short-term changes your federal rate bracket, so get that right first.

Sofia S.

Author

Held it about four years so definitely long-term. Good to know the federal piece is at least clean.

Don't forget your cost basis adjustments on the rental. Depreciation you claimed (or were allowed to claim) over the years reduces your adjusted basis, which increases the gain. That depreciation recapture portion gets taxed at a different federal rate than the rest of the long-term gain. Publication 550 covers holding period but for rental property depreciation recapture you'll want the Schedule D instructions and Form 4797.

Sofia S.

Author

I did depreciate it. Wasn't thinking about recapture at all — going back to look at Form 4797 now. Does the nonresident state tax the recapture the same way the federal does?

States vary a lot on that. Some conform to federal treatment of recapture, some don't. You'll need to read the nonresident state's instructions for its equivalent of Schedule D or its income tax form. Can't give you a blanket answer there.

Had a similar nonresident sale last year and I was worried about the double-filing piece too. I uploaded both state returns and my federal 8949 to taxr.ai and asked it to map which lines on my resident state return fed the other-state credit calculation — it flagged that I'd pulled the wrong line as my "tax paid" figure, which would have undercut my credit. Worth doing before you file. On the substance: the nonresident state return is where you establish the actual tax owed on the gain, and that number is what your resident state credits. File the nonresident return first so you have the confirmed number.

File the nonresident return first — that's the right order. Some resident states even ask you to attach the nonresident return or a schedule showing the other state's tax. If you file simultaneously and the numbers don't match what you later report on the nonresident return, you may need to amend the resident return.

Is there a deadline difference between the two states that could make filing nonresident first difficult?

Most states follow the federal deadline but not all. Check each state's department of revenue site. If the deadlines are the same and you can't file nonresident first, file both together with your best estimate of the other-state tax and amend if the nonresident return shakes out differently.

The withholding your closing attorney remitted was almost certainly under that state's nonresident real property withholding rules — many states require it at closing as a prepayment. When you file the nonresident return you'll claim it on that return, same as federal estimated tax payments. Keep the closing disclosure and any withholding certificate the attorney gave you; you'll need those numbers.

Sofia S.

Author

Got the closing disclosure. The attorney also gave me a form specific to that state confirming the withholding amount. Should I attach that to the nonresident return?

Usually yes, or at minimum keep it. Each state handles attachment requirements differently — check the instructions for that state's nonresident individual income tax return to see if they want it attached or just retained.

Went through this two years ago with a property in a different state. I had Taxr read through both state instruction booklets alongside my closing disclosure and draft both nonresident and resident schedules — it laid out exactly which figures from the nonresident return carried to the credit worksheet on my resident return and flagged a basis number I'd misread from the depreciation schedule. Really cut down on the back-and-forth between two sets of state instructions.

Did your resident state cap the credit at the resident state's own tax rate on that income, or did it allow the full nonresident tax paid?

Capped it. My resident state's credit was limited to the lesser of the nonresident tax actually owed or what my resident state would have charged on that same gain. Ended up with a small amount still owed to my resident state because its rate was slightly higher on that income. Every state's credit formula is a little different though.

One thing people get wrong: the credit is for tax paid to the other state, not for withholding. If your withholding exceeded the nonresident tax and you got a refund, the credit is based on the tax owed, not on what was withheld. If you use the withholding amount instead of the actual tax, you could be overclaiming the credit on your resident return.

Sofia S.

Author

This is exactly the mistake I almost made. So I need the finalized nonresident return to get the right number, not just my withholding certificate.

Exactly. The withholding certificate tells you what was prepaid, not what you owed. The tax on the nonresident return is what matters for the credit.

For federal, check whether your software is handling the Form 4797 and Schedule D interaction correctly for rental property. The ordinary income piece from depreciation recapture flows through Form 4797 to Schedule 1, not directly to Schedule D. The remaining long-term gain goes to Schedule D. Those are two different animals and mixing them up changes your federal tax significantly.

Also worth noting: capital losses from other sales this year can offset the gain on Schedule D. If you have any losing positions in a brokerage account, the net on Schedule D is what matters. Just don't trigger a wash sale by repurchasing substantially identical securities within 30 days before or after a loss sale — that disallowed loss gets added to the basis of the new shares instead.

Sofia S.

Author

I do have some brokerage losses this year. So those offset against the property gain on the same Schedule D?

Yes, all capital gains and losses — real property, stocks, whatever — net against each other on Schedule D. Short-term nets with short-term, long-term with long-term, then those two nets combine. If losses exceed gains overall, there's a cap on how much of the excess you can deduct against other income in one year — the Schedule D instructions and Topic 409 on irs.gov lay out the limit and carryforward rules.

The state where the property was physically located can tax the gain regardless of where you live — that's a consistent rule across states that have an income tax. What varies is how aggressive your resident state is about the credit calculation and whether it conforms to federal capital gains treatment or has its own rates. Some states tax all capital gains as ordinary income.

Sofia S.

Author

My resident state does have its own capital gains treatment — lower rate than ordinary income. Does that affect how the credit is calculated?

Yes potentially. If your resident state applies a different rate to the gain, the credit ceiling — the "what my state would have charged" portion — is calculated at that rate. So if your resident state's rate on the gain is lower than the nonresident state's rate, you might still owe something to your resident state after the credit.

If the gain is large enough that the credit still leaves a meaningful balance, or if either state is auditing nonresident real estate transactions closely, it may be worth having an enrolled agent or CPA who works in both states review both returns before you file. Nonresident returns with real property sales are one of the more common triggers for state-level correspondence.

Sofia S.

Author

How do I find someone who handles both states? Just ask if they're licensed in both?

Enrolled agents are federally licensed so they can represent you federally in both states, but state practice rights vary. A CPA licensed in both states or an EA familiar with both states' returns is what you want. Ask specifically whether they prepare nonresident returns for each of your states regularly.

Don't overlook your adjusted basis calculation before you even get to the gain. For a rental property: original purchase price plus closing costs at acquisition plus any capital improvements, minus accumulated depreciation. If you've owned it four years and took depreciation each year, that reduces basis and increases your recognized gain. The IRS page on basis of assets at Publication 551 covers the full framework.

Confirm the nonresident state's withholding rate was applied correctly at closing too. Some states have a flat withholding percentage on gross proceeds, others on the estimated gain. If it was applied to gross proceeds and your gain was actually a small fraction of that, you may be getting a substantial refund on the nonresident return — which also means the credit on your resident return will be smaller than the withholding suggested.

Sofia S.

Author

The withholding was based on gross proceeds. My gain is way less than that after basis. So yeah, expecting a big refund from the nonresident state.

Then file that nonresident return as soon as you can. The refund won't come until you file, and you'll need the confirmed tax-owed figure to finalize your resident state credit anyway.

Quick question for anyone who knows: does the state where the property is located get to tax the full gain including federal depreciation recapture, or only the "capital" portion?

Depends on the state. Most states that conform to federal definitions will treat recapture the same way — ordinary income portion separate from capital gain. But some states don't have their own capital gains preference and tax everything at ordinary income rates, in which case the distinction doesn't matter for state purposes. Read the nonresident state's return instructions for how it treats "gain from sale of real property" — that's usually the clearest guide.

Sofia S.

Author

Coming back to summarize what I've learned here: file nonresident return first to get the actual tax-owed figure, use that number (not withholding) for the resident state credit, make sure basis is right including depreciation, handle Form 4797 for recapture separately from Schedule D, and check both states' treatment of capital gains vs. ordinary income. Thanks everyone — this was a lot more involved than I expected but at least I know the right order of operations now.