Keyword Density means that, how many number of times a same keyword appears on a web page.
For example if your blog post or web page is filled with content of 600 words and your focus keyword is showing 12 times.
Now keyword density can be calculated by this formula :
Keyword Density = (Keyword Appearances/Total no of words)*100
By using this formula we can find the keyword density of any keyword on any page.
For our example of 600 words page and 12 times the keyword
==> (12/600)*100 = 2
That is the keyword density of that page 2%.
The best keyword density for fully optimised webpage is around 2 to 4%. For better optimization try to include keywords in places like website title, description, image alt texts, heading tags etc.