The formula to calculate your keyword density on a web page for SEO purposes is ( N k r / T k n ) ∗ 100 {\displaystyle (Nkr/Tkn)*100} , where Nkr is how many times you repeated a specific keyword, and Tkn the total words in the analyzed text. The result is a keyword density value. When calculating keyword density, ignore html tags and other embedded tags which will not appear in the text of the page once published.