Charities generally do not pay capital gains tax. A 501(c)(3) organization that sells donated stock, investment real estate, or other appreciated property keeps the full proceeds because its federal income tax exemption covers those gains. Three situations break that rule: private foundations owe a small excise tax on investment income, gains tied to borrowed money can be taxable, and sales that count as unrelated business income are taxed at regular corporate or trust rates.
Why the General Rule Is No Tax
Organizations recognized under Section 501(c)(3) are exempt from federal income tax, and capital gains fall inside that exemption.1Office of the Law Revision Counsel. 26 USC 501 – Exemption From Tax on Corporations, Certain Trusts, Etc The tax code then reinforces the point in a second place. Section 512 specifically excludes dividends, interest, royalties, most rents, and gains from selling investment assets from unrelated business taxable income.2Office of the Law Revision Counsel. 26 USC 512 – Unrelated Business Taxable Income An endowment can grow through decades of realized gains and owe nothing when positions are sold.
The practical difference is large. An individual selling stock for a $500,000 gain could owe well over $100,000 in federal tax. A qualified charity selling the same stock keeps every dollar. That gap is also why advisors routinely tell donors to give appreciated stock directly rather than sell it and donate cash.
The Private Foundation Excise Tax
Private foundations are the main exception on the investment side. Section 4940 imposes a flat 1.39% excise tax on a private foundation’s net investment income, which includes realized capital gains.3Office of the Law Revision Counsel. 26 USC 4940 – Excise Tax Based on Investment Income The tax applies regardless of whether the money ultimately funds grants or operating costs. Foundations calculate and report it on Form 990-PF, subtracting allowable investment expenses from gross investment income.4Internal Revenue Service. 2025 Instructions for Form 990-PF
The rate is far below individual or corporate capital gains rates, but it is mandatory and it compounds. A foundation with $100 million in assets generating $5 million in annual investment income owes roughly $69,500 on that income alone each year.
One narrow escape hatch exists for “exempt operating foundations.” A foundation avoids the 1.39% tax if it meets all of these conditions:
- It qualifies as an operating foundation, actively running charitable programs rather than just making grants
- It has been publicly supported for at least 10 consecutive tax years
- At least 75% of its governing board members are not disqualified individuals such as substantial contributors or their family
- The board is broadly representative of the general public
- None of its officers are disqualified individuals
Few foundations satisfy every requirement.3Office of the Law Revision Counsel. 26 USC 4940 – Excise Tax Based on Investment Income Public charities are not subject to this tax at all.
When Borrowed Money Is Involved
Buying investment property with debt strips away part of the exemption. Under Section 514, when a charity holds property with outstanding acquisition debt, a portion of any gain on sale is treated as unrelated business taxable income.5Office of the Law Revision Counsel. 26 USC 514 – Unrelated Debt-Financed Income
The taxable share is set by a ratio. The IRS compares the average outstanding debt on the property to its average adjusted basis during the year.6eCFR. 26 CFR 1.514(a)-1 – Unrelated Debt-Financed Income and Deductions If a charity owns a building worth $1 million with $400,000 still owed on the mortgage, roughly 40% of the gain on sale is taxable. The remaining 60% stays tax-free.
Land purchases have a specific exception. A charity that buys real property in the neighborhood of land it already uses for exempt purposes can avoid the tax if it puts the new parcel to exempt use within 10 years. Churches get 15 years and do not need to satisfy the neighborhood test.7GovInfo. 26 USC 514 – Unrelated Debt-Financed Income The organization has to show real intent to convert the land. Simply holding it as an investment while carrying debt does not qualify.
When a Sale Counts as Business Income
The investment exemption in Section 512 assumes the charity is holding assets as investments. If the organization is instead in the business of buying and selling property, the profits become unrelated business income. Section 513 defines an unrelated trade or business as any activity whose connection to the organization’s exempt purpose goes no further than generating revenue.8Office of the Law Revision Counsel. 26 USC 513 – Unrelated Trade or Business
Any exempt organization with $1,000 or more in gross unrelated business income must file Form 990-T.9Internal Revenue Service. Unrelated Business Income Tax The rate depends on the organization’s legal form. Nonprofits organized as corporations pay the flat 21% corporate rate. Those organized as trusts pay graduated trust tax rates that can reach 37%.10Office of the Law Revision Counsel. 26 USC 511 – Imposition of Tax on Unrelated Business Income of Charitable Organizations A trust-form charity with meaningful unrelated income can face a notably higher rate than a corporate-form one on the same numbers.
The Donor Side of the Same Rule
Because the charity does not owe capital gains tax, donors giving appreciated property directly get a double benefit. You avoid recognizing the capital gain, and you claim a charitable deduction for the property’s full fair market value.11Internal Revenue Service. Publication 526 – Charitable Contributions
The math is simple. If you bought stock for $10,000 and it is now worth $60,000, selling the stock triggers a $50,000 capital gain. Donating it directly skips that gain entirely and produces a $60,000 deduction, subject to annual limits. Few strategies both reduce taxable income and eliminate a capital gains bill.
The deduction for capital gain property given to a public charity is capped at 30% of your adjusted gross income. You can elect a higher 50% limit, but only if you reduce the deduction to your cost basis rather than the property’s fair market value. Donations to private foundations carry a 20% AGI cap. Unused deduction carries forward up to five years.11Internal Revenue Service. Publication 526 – Charitable Contributions Noncash contributions totaling more than $500 for the year require Form 8283, and items or groups of similar items valued above $5,000 require a qualified appraisal attached to the form.12Internal Revenue Service. About Form 8283 – Noncash Charitable Contributions
The picture that emerges is narrower than the headline exemption suggests. A public charity selling investments owes nothing. A private foundation selling the same investments owes 1.39% on the gain. A charity of either type that borrowed to buy the asset owes tax on the debt-financed slice. And any charity that runs sales as a business rather than as investment activity is taxed on the profits at ordinary corporate or trust rates.