Just like gifts to married or civil partners, anything you leave to a charity is deducted from the value of your estate. For instance, if you died leaving an estate worth £350,000 including a charitable gift of £30,000, you would not need to pay and inheritance tax. Your estate would be calculated as being worth £320,000 (£350,000 - £30,000), and therefore below the nil rate band.
On top of this, if you leave 10% of your 'net' estate to charity, the inheritance tax rate will be reduced from 40% to 36%.
For example, if you are unmarried, do not have a property and leave an estate worth £525,000 to your two children, your net estate is worth £200,000 (£525,000 minus your nil rate band of £325,000). At the normal inheritance tax rate of 40%, you will owe £80,000 in tax, leaving your children to inherit £445,000 in total.
However, if you include a charitable gift of £20,000 (10% of your £200,000 net estate), leaving the remaining £505,000 to your children, then the inheritance tax rate is reduced to 36%. Now you will only owe inheritance tax on £180,000 (£505,000 minus your nil rate band) and at the reduced rate of 36% - resulting in a tax bill of £64,800.
The result is that your children receive £440,200 (£4,200 less than before), the charity receives £20,000 and you save £15,200 on inheritance tax. So while this does mean that your beneficiaries receive less, if there are charitable causes you feel strongly about, this is a very efficient way of giving to them.