US President Donald Trump makes his way to board Marine One before departing from the South Lawn of the White House in Washington, DC on March 2, 2020. Mandel Ngan | AFP | Getty Images

President Donald Trump is giving away part of his salary to help stop coronavirus, and he just might be able to take a tax break for doing so. The president donated $100,000 — his salary for the fourth quarter of 2019 — to the Department of Health and Human Services. Trump has donated his salary to a different federal agency each quarter since he's been in office. Tweet It pays to be generous. "Taxpayers can claim a deduction for gifts to the federal government as long as they itemize deductions on their returns," said Joshua Blank, a law professor at the University of California, Irvine School of Law. "Trump gets the income and he wants to give it to someone else," he said. "Is there a deduction allowed? "By statute, the answer is yes," Blank added. "But he has to pay taxes on income received."

You have to earn it before giving it away

Camille Tokerud | Getty Images

In order to get any kind of tax benefit from donating part of your salary, you'll need to pay your share to Uncle Sam first. Income and payroll taxes will still apply to the money you earn, even if you give everything away. "You can't just assign the income to someone else and tell the IRS to go tax them," said Michael D'Addio, principal at Marcum LLP in New Haven, Connecticut. "It's more like you receive the income first and then transfer it to a third party." Further, there's a limit to your donation. That is, your whole salary may not be eligible for a write-off.

In the case of cash contributions, including salary donations, you can deduct no more than 60% of your adjusted gross income. Finally, there's a distinction between donating your pay versus avoiding compensation altogether. If you waive payment for your services, you can't write it off. "If I can donate services as a lawyer and claim the deduction, I would be getting an economic benefit from the deduction without ever being taxed on the labor," said Blank. "When the president gets his paycheck, he has to be taxed on it to claim the deduction," he said.

Maintaining documentation

The Internal Revenue Service (IRS) headquarters in Washington, D.C. Janhvi Bhojwani | CNBC