After the £500 dividend allowance, a basic-rate taxpayer (£30,000 salary) pays approximately £394 in dividend tax on £5,000, and a higher-rate taxpayer (£55,000 salary) pays approximately £1,519.
Step 1, Personal Allowance. Salary fills the Personal Allowance (£12,570) first. At £30,000 the full allowance is used, so dividends get no PA shelter. Same at £55,000.
Step 2, Dividend allowance. The first £500 of dividends is free from dividend tax. After that, £4,500 is potentially taxable.
Step 3, Bands. Salary fills the basic-rate band first. A £30,000 salary leaves £20,270 of the basic-rate band for dividends at 8.75%. A £55,000 salary already exceeds £50,270, so all dividends fall in the higher-rate band at 33.75%.
Your actual position may differ. These are illustrative scenarios. Use the calculator with your real salary and pension contributions for a precise figure.