Many plaintiffs win or settle a lawsuit and are surprised they have to pay taxes. Some don’t realize it until tax time the following year when IRS Forms 1099 arrive in the mail. A little tax planning, especially before you settle, goes a long way. It’s even more important now with higher taxes on lawsuit settlements under the recently passed tax reform law. Many plaintiffs are taxed on their attorney fees too, even if their lawyer takes 40% off the top. In a $100,000 case, that means paying tax on $100,000, even if $40,000 goes to the lawyer. The new law generally does not impact physical injury cases with no punitive damages. It also should not impact plaintiffs suing their employers, although there are new wrinkles in sexual harassment cases. Here are five rules to know.

1. Taxes depend on the “origin of the claim.” Taxes are based on the origin of your claim. If you get laid off at work and sue seeking wages, you’ll be taxed as wages, and probably some pay on a Form 1099 for emotional distress. But if you sue for damage to your condo by a negligent building contractor, your damages may not be income. You may be able to treat the recovery as a reduction in your purchase price of the condo. The rules are full of exceptions and nuances, so be careful, how settlement awards are taxed, especially post-tax reform.

2. Recoveries for physical injuries and physical sickness are tax-free, but symptoms of emotional distress are not physical. If you sue for physical injuries, damages are tax-free. Before 1996, all “personal” damages were tax-free, so emotional distress and defamation produced tax-free recoveries. But since 1996, your injury must be “physical.” If you sue for intentional infliction of emotional distress, your recovery is taxed. Physical symptoms of emotional distress (like headaches and stomachaches) is taxed, but physical injuries or sickness is not. The rules can make some tax cases chicken or egg, with many judgment calls. If in an employment dispute you receive $50,000 extra because your employer gave you an ulcer, is an ulcer physical, or merely a symptom of emotional distress? Many plaintiffs take aggressive positions on their tax returns, but that can be a losing battle if the defendant issues an IRS Form 1099 for the entire settlement. Haggling over tax details before you sign and settle is best.

3. Allocating damages can save taxes. Most legal disputes involve multiple issues. You might claim that the defendant kept your laptop, frittered away your trust fund, underpaid you, failed to reimburse you for a business trip, or other items. Even if your dispute relates to one course of conduct, there’s a good chance the total settlement involves several types of consideration. It is best for plaintiff and defendant to agree on tax treatment. Such agreements aren’t binding on the IRS or the courts in later tax disputes, but they are usually not ignored by the IRS.

4. Attorney fees are a tax trap. If you are the plaintiff and use a contingent fee lawyer, you’ll usually be treated (for tax purposes) as receiving 100% of the money recovered by you and your attorney, even if the defendant pays your lawyer directly his contingent fee cut. If your case is fully nontaxable (say an auto accident in which you’re injured), that shouldn’t cause any tax problems. But if your recovery is taxable, watch out. Say you settle a suit for intentional infliction of emotional distress against your neighbor for $100,000, and your lawyer keeps $40,000. You might think you’d have $60,000 of income. Instead, you’ll have $100,000 of income. In 2005, the U.S. Supreme Court held in Commissioner v. Banksthat plaintiffs generally have income equal to 100% of their recoveries. even if their lawyers take a share.

How about deducting the legal fees? In 2004, Congress enacted an above the line deduction for legal fees in employment claims and certain whistleblower claims. That deduction still remains, but outside these two areas, there’s big trouble. in the big tax bill passed at the end of 2017, there’s a new tax on litigation settlements, no deduction for legal fees. No tax deduction for legal fees comes as a bizarre and unpleasant surprise. Tax advice early, before the case settles and the settlement agreement is signed, is essential.

5. Punitive damages and interest are always taxable. If you are injured in a car crash and get $50,000 in compensatory damages and $5 million in punitive damages, the former is tax-free. The $5 million is fully taxable, and you can have trouble deducting your attorney fees! The same occurs with interest. You might receive a tax-free settlement or judgment, but pre-judgment or post-judgment interest is always taxable (and can produce attorney fee problems). That can make it attractive to settle your case rather than have it go to judgment. For a crazy example how these tax rules can whittle after-tax amounts to nothing, check out how IRS taxes kill plaintiff’s $289M Monsanto weedkiller verdict.