Assume I have a stock that I purchased for $1000 and it now has a value of $5000, a potential long term capital gain of $4000. Assume also that I owe $20750 in total tax on an income of $80000 based on this calculator,
If I sold the stock and paid 15% capital gain tax on the 4k * 15% = 600. $3400 remain to help pay for the income tax for a total out of pocket expense around 20750-3400=17350.
If I gift the stock to charity I get a $5000 deduction from my gross 80k income for a taxable amount of 75K. The tax I then owe is ~19K.
Why would anyone then gift an appreciated stock to charity if it makes more sense to sell it and pay the capital gain tax??