"Keyword density" is a dubious metric these days. It is usually presented as a percentage and is computed by the occurrence of the targeted keyphrase divided by the entire text of the page in question. Various approaches will make the computation using various stop words (e.g. the, it, but, and) or not, including various head tags (title, description, keywords, etc.) or not, including html comments or not, including html attributes (title, alt, etc) or not, etc. Going all the way back to AltaVista (for those that have memories that long) keyword density was an important metric, since rankings were largely determined by on-page factors. These days it has, in my opinion, lost most of its use as a metric for SEO. Copy should be written naturally, with the end user rather than the SE's in mind.
Keyword density is the percentage of times a keyword or phrase appears on a web page compared to the total number of words on the page. In the context of search engine optimization keyword density can be used as a factor in determining whether a web page is relevant to a specified keyword or keyword phrase. Google use the google juice and show many other result to using keyword density.
Keyword density in today's terms is just plain nonsense. Dr. Garcia describes how useless and ineffective a metric it would be in terms of relevant search results. You can review that at http://www.e-marketing-news.co.uk/Mar05/garcia.html I suggest everyone thinking keyword density is useful to read this article. Warning: Lots of Math!
Keyword density is a percentage of keywords repeated how much times which you use in web page contact.. well always you should use 3 to 4 time keywords maximum ..otherwise if you use more time same keywords then google will not cowler and may be your website under black hat techniques ..so don't use these techniques..
Don't worry about keyword density ! Just make sure you add the targeted keywords in important places - Title, Url, first paragraph.
I highly recommend that you dont think about keyword density, if you do, while placing any text on a site then you wont be writing naturally.
Keyword page density is a measure of the frequency of the word or phrase in the contents that appear in the web page. It is expressed as a percentage. For example, if a specific word is used 5 times on a page containing 100 words, the keyword density is 5%. More about Keyword Density
What is the best measure of using keyword density, for example if we have a document of 100 words, what would be the ideal keyword density that is perfect for search engines? Should it be 5%, less or more?
I recommend it to be 5% to 8%. Don't make it higher than 10% though. And you can measure your keyword density with Keyword Density = (Keyword/Total Words) * 100