It’s the holidays, time to express your gratitude for all you’ve got: A company you can call your own, enough money to get by, and causes you believe in. A lot of those causes, of course, count on seasonal waves of giving-back sentiment from generous people like you, and are in furious fundraising overdrive even as you read this. There is no more dangerous place to stand this time of year than between a 503(c) organization and a potential donor.

Did someone mention the year-end tax deadline? The U.S. tax code, in rare departure from its usual confusion, encourages you to do the right thing—that is, donate to a worthy cause. In return, you can deduct your contribution from your taxable income come April, as long as you make your donation before the end of this year. This is a meaningful savings: Thanks to the deduction, you only need to earn $1 to donate $1. Without the break, you’d need to earn as much $1.60 or so, depending on your state tax bracket.

Still, this being the U.S. tax code, there are all sorts of ways good intentions can go awry. So keep the following in mind:

You can only claim the charitable deduction if you itemize deductions on your tax return. Most Americans don’t, but you probably do. Just check. There is one exception, which we’ll get to later and which (don’t get your hopes up) applies only to older taxpayers.

Just in case you had a recent liquidity event and were planning to, say, rescue the Newark New Jersey school system, or end world thirst, note that there are limits to how generous you can be and still get the tax break. Cash donations to public charities can’t exceed 50% of Adjusted Gross Income (AGI) and donations of appreciated assets (like those Facebook shares that have made billioinaires of Mark Zuckerberg and Sean Parker) are limited to 30% of AGI. Public charities typically consist of religious organizations, hospitals, your alma mater, and so on. Private charities, such as veterans’ organizations and private foundations, have a 30% AGI limit on cash donations and a 20% limit on appreciated assets. If you’re not sure which kind of charity is the object of your bountiful impulse, ask.

It’s usually a better idea, taxwise, to give securities instead of cash, especially if you own any stock that has gone up since you acquired it. Selling shares that have risen in value will trigger capital gains taxes. However, if you donate the security directly to a charity, you get a deduction equal to the market value of the security and you never have to pay those capital gains taxes. Ever.

All this applies to your business too, as long as it's a sole proprietorship, partnership, LLC or S-Corp. In those entities, taxes flow through to your personal tax return. So whether you should make the donation yourself or in the name of the company is entirely up to you.  You may decide that it’s better to let the company get the credit for making the contribution, especially if it helps build your company’s good will in the community, or if you expect your generosity to have a good effect on employees' morale (although some may wonder why you didn't give the money to them.)

Now for that one exception to the rule about itemized deductions: If you are over age 70 ½ and are taking Required Minimum Distributions (RMD) from your IRA, you may donate up to $100,000 from your IRA directly to a charity and the money will not be recognized as income. Both you and the IRS get to act as if you never got the money. Apart from the fun of legally spending, tax free, up to $100,000 that the IRS has been waiting your whole career to lay its hands on, you get the benefits of a big write-off without having to claim it as an itemized deduction.

The moral: Generosity is its own reward this time of year. But do it right, and it also comes with a big fat tax break.

Matt Haas, CPA contributed to this article