The alternative minimum tax came into being half a century ago as lawmakers tried to prevent the very rich from escaping their fair share of federal income taxes. It requires high-income earners to run the numbers twice — under regular tax rules and under the stricter AMT rules — and pay the higher amount owed.

Unlike regular income tax, the AMT wasn’t tied to inflation, so this tax is affecting a growing number of middle-class filers now.

Here’s what you need to know about the extra tax bite.

Quick history lesson: The minimum tax, the AMT’s predecessor, was enacted by Congress in 1969 in response to data showing that 155 taxpayers making more than $200,000 per year —  equivalent to about $1.3 million in today’s dollars — had paid no taxes after taking advantage of benefits and deductions. That add-on to the regular income tax was replaced 10 years later by the AMT, whose reach started expanding because the AMT exemption thresholds did not rise with inflation for many years. So the result is that the AMT, which initially targeted the wealthy, has reached down to touch those at middle-income levels.

According to the Tax Policy Center, a Washington think tank, nearly one-third of the households affected by the AMT now are those with an annual income (broadly measured by the center) of $200,000 to $500,000. Those earning between $500,000 and $1 million also are likely to be vulnerable.

Situations besides having a higher income could draw taxpayers into the AMT zone. The AMT is more likely to affect you if:

» MORE: State income tax rates

The AMT runs parallel to the standard tax system, but has a different tax rate structure and eliminates many common deductions.

Some good news: Tax software will do both sets of calculations automatically. As you enter your information, the program will run the numbers in the background according to both the regular tax system (using Form 1040) and AMT rules (using Form 6251).

The AMT has two tax rates: 26% and 28%. (Compare these to the seven federal income tax rates, ranging from 10% to 39.6%.)

The AMT also has exemptions that function like the standard deductions under the regular tax system: They protect at least some of your income from tax by reducing your taxable income. And because AMT rules disallow many tax breaks, the exemption amounts are higher than standard deductions — for example, $53,900 vs. $6,300 for single filers.

How does it work?

In 2012, as millions of people were about to get affected by the AMT, Congress passed a law calling for the AMT exemption amounts to be permanently adjusted for inflation.

Here are the AMT exemption amounts for the 2016 tax year:

Each exemption begins to phase out after the AMT income crosses a certain threshold. In the middle zone — between where the phaseout begins and ends — because of how the phaseout rules work, your AMT income can end up being taxed at a rate of up to 35%, which is higher than AMT’s 26% or 28% rates. As a result, many AMT planning strategies involve taking steps to avoid the zone by — counterintuitively — increasing your amount of taxable income.

Taxpayers typically look for deductions, credits and other ways to reduce their taxable income. Under the AMT, you can’t take many of these breaks.

You can’t deduct state and local taxes, or miscellaneous items such as investment fees and interest and unreimbursed travel expenses. Personal exemptions (dependents, for instance) and the standard deduction are out, too. Deductions for medical expenses and for a range of business items are curtailed.

Investors, also, could face AMT. Long-term capital gains and certain dividends could push your income into the AMT system.

There’s some good news: You still can deduct charitable contributions and mortgage interest (although home-equity loan interest faces stricter scrutiny).

For more information, check the instructions for IRS Form 6251, which enables the calculation of AMT.

» MORE: Try our tax calculator

First, figure out whether you are vulnerable to the AMT and be aware of how it can be triggered.

Form 6251, which has 64 lines, requires multiple calculations to determine if you owe AMT. The IRS has an online assistant to help you figure out whether you need to complete the form, but the federal agency says the easiest way to calculate your possible AMT is to use tax software.

There isn’t much you can do to avoid paying AMT if you find out you have to pay it when filing your return. But you can plan ahead for the next year by following these strategies:

If you suspect that you might owe AMT, consult a tax expert to help you with the additional paperwork and on reducing or avoiding the tax.

There’s potential hope on the legislative front: President Donald Trump and House Speaker Paul Ryan want to eliminate the alternative minimum tax.

The article How Does the Alternative Minimum Tax Work? originally appeared on NerdWallet.