The formula
density = occurrences × words in the keyword ÷ words in the text × 100
Where it comes from
The sum is simple and has a catch most tools skip: searching for "VAT" as plain text also finds the "vat" inside "private". Here each match is checked for letters or digits on either side, so only whole words count. Accents are ignored when comparing, because "café" and "cafe" are the same word to a search engine and to almost any reader.
How to work it out by hand
- Count the total words in the text
- Count the occurrences of the keyword as a whole word
- Multiply the occurrences by the words the keyword spans
- Divide by the total and multiply by a hundred
What is worth knowing
It is worth saying plainly: **keyword density stopped being a ranking factor many years ago**, and forcing it backfires. Search engines have spent decades detecting stuffing, and a text that repeats a term every other line reads badly, which is what actually costs you. The figure still has a use, but it is the opposite of the one assumed: it is for checking that the term appears **at all**, and above all in the places that count — the title, the first paragraph, a heading — rather than never appearing because the text keeps dodging it with synonyms. If a page about VAT calculators never once says "VAT calculator", that is a real problem.