Tens of thousands of American homeowners have just received a rare and unexpected concession from Uncle Sam: A tax break on their future mortgage-interest deductions.

Yes, you read it right: Relief from future taxes on your real estate, not a federal tax hike.

Tucked away in the fine print of Capitol Hill's massive 1987 "technical corrections" tax bill is an obscure section that could keep dollars in your wallet this year and next. Here's what it's all about, and how you can tell if you qualify.

When Congress passed the Tax Reform Act late last summer, it split America's 60-million-plus home-owning households into two separate and unequal groups. Owners who had purchased, financed or refinanced their home mortgages on or before Aug. 16, 1986, were "grandfathered" on their mortgage-interest tax deductions. Whatever the size of the mortgage debt against your principal residence as of that date, you were guaranteed the right to continue deducting 100 percent of your home-loan interest on your federal tax returns.

Whether you had a $20,000 first deed of trust or a $2 million total of first, second and third mortgages against your place, it didn't matter. As long as you made the Aug. 16 cut, Congress said, you were safe from the clutches of tax revision.

Owners who fell on the far side of Aug. 16 were treated less hospitably. The 1986 tax bill decreed that they could never deduct mortgage interest on home loans that exceeded the original purchase price of the property, plus the cost of subsequent capital improvements. The sole exceptions would be for mortgage debt incurred to pay for "qualified medical or educational" expenses.

At first glance, the vast majority of the nation's homeowners appeared to end up on the happy side of the divide. They wouldn't have to worry about the new deduction limitations unless they sold their current home, purchased another, and refinanced years later.

But the first glance proved wrong. The tax-revision writers on Capitol Hill had built a catch-22 for homeowners who thought themselves safely grandfathered. Any owners who already had refinanced their loans prior to Aug. 16 and then sought to refinance again at some future date -- say in 1987, 1988 or beyond -- had a rude shock in store, tax experts confirmed.

They would be bucked back to their original sales price on the home plus the cost of capital improvements. Mortgage interest on any amounts beyond that would be nondeductible, unless they were for bona fide educational or medical expenses.

Large numbers of homeowners stood vulnerable to this surprise tax trap. Worst hit of all were longtime, stable residents -- often couples in their 50s and 60s who had purchased homes 15 and 20 years earlier, raised children, refinanced once along the way, and steadily built up their equity.

Take, for example, the case of the couple who had purchased a house in 1966 for $50,000, improved it with $10,000 worth of renovations, and refinanced in 1983 at 13 percent. Now they're eager to refinance again to take advantage of this year's lower rates and the higher market value of their property. Their house is worth $200,000.

But under last year's tax bill, they suddenly face what amounts to a severe federal tax penalty for seeking a lower interest rate. They can refinance to the hilt, pulling out $180,000 with a 90 percent loan. But they can only deduct mortgage interest on the first $60,000 worth of their new $180,000 loan. That's because they're forced back to the original price ($50,000) plus cost of improvements ($10,000) tax-revision limit.

Thanks to the sharp eye and negotiating skills of a key congressman, however, it now appears that inequities like this will be far less common. Rep. Robert T. Matsui (D-Calif.), a member of the House Ways and Means committee, squeezed corrective language into this year's bipartisan technical-corrections tax bill. He also persuaded the Treasury Department to give his compromise plan its legal blessings. Formal action on the bill won't come until this fall, but Matsui says his provision can be relied upon for tax-planning purposes.

The solution works like this: If you're like the couple above, you can be "grandfathered" once again. You can refinance your loan, but only up to the amount of debt you had against the house as of last Aug. 16. You won't be bucked back to your original sales price, in other words. The new term of your refinanced mortgage can only go for the number of years you had remaining on your existing loan, as of Aug. 16, 1986.

Finally, if you have a lump-sum "balloon" mortgage coming due down the road, don't fret. Under the Matsui plan, you can refinance it up to the amount of your indebtedness last Aug. 16 without falling into the time-warp tax-revision trap.