Image source: Getty Images.

Taxpayers need to take advantage of every tax deduction they can find in order to minimize what they pay to the Internal Revenue Service. What comes as a surprise to many taxpayers is that if they're unfortunate enough to have to pay taxes at the state level, those payments can actually serve as the basis for a deduction on their federal tax return. However, there are some complicated rules to follow in order to make sure you get every penny that's coming to you. Below, we'll look more closely at state taxes and how you can deduct them on your 1040.

Which state taxes are deductible?

Historically, state income taxes were the primary deductible item for those who had to pay tax to their state governments. Any money that you paid to the state for income tax was deductible, whether you did so through payroll withholding or by direct payments to the state revenue collector. One confusing element is that the year in which you're allowed to deduct tax payments is the year in which they're made. So if like many taxpayers, you end up paying your 2015 state income tax bill in April 2016, then you don't get to claim that deduction until you file your 2016 federal return early next year. That's the case even though the state taxes that you were paying were for the 2015 tax year.

More recently, the tax laws were changed to allow you to claim a deduction for state sales taxes. You're not allowed to claim both income and sales taxes. However, you can pick whichever amount is larger for you. The benefit of the law change was to allow residents in states that didn't charge an income tax to get at least some benefit from the state tax deduction. Currently, those states include Alaska, Florida, Nevada, South Dakota, Texas, Washington, and Wyoming. Moreover, because there are special tables that allow you to claim a safe-harbor deduction amount for sales tax without having to tack every purchase, the recordkeeping can be easier than you would expect.

How can you deduct state taxes?

You're allowed to claim the amount you pay during a given year as an itemized deduction on Schedule A. What that means is that if your total itemized deductions, including not only state taxes but also other items that you're allowed to itemize, exceed the standard deduction, then you get the benefit of those deductions in reducing your outstanding tax liability. If your tax payments are less than the standard deduction, however, then it's still smart to claim the higher standard deduction amount -- even though it means that you essentially don't get any credit for the tax break for state taxes.

To get a deduction for state income tax paid, you have to have actually paid the amount claimed. For sales taxes, though, you can claim a certain amount that varies by state, income level, and number of exemptions claimed. This IRS calculator can also help you find the appropriate deduction amount for sales tax for your situation.

Watch out for the AMT

One thing to keep in mind is that even though you can deduct state income and sales tax payments on your federal return for purposes of calculating regular tax, different rules can apply to take away that deduction. In particular, the Alternative Minimum Tax doesn't offer a deduction for state and local taxes, and so you have to add back those amounts to your taxable income for AMT purposes. Therefore, if you're subject to the AMT, you'll essentially get no tax break from the money you pay in state taxes.

Having to pay state taxes isn't anyone's favorite thing to do. However, getting to take a federal deduction for the state taxes you pay is at least a small silver lining for bearing a double tax burden. By knowing the rules governing deductions of state tax, you can make sure you'll save as much as you can from the money you pay in taxes everywhere.