Keyword density is simply the frequency at which important keyword appears in an article.
Keyword density = (Nkr/Tkn) X 100
Where, Nkr = Number of time repeated keyword
Tkn = Total number of words in the article
In simple example, suppose you are writing an article of 500 words on banking, and you targeted a keyword “HDFC Bank”. As because you find it in Gogle Adword tools. Now in that 500 word article to do better in search engine result you use your keyword 15 times.
Here your, Nkr = 15 time you repeated the special keyword
Tkn = Article is of 500 word
Keyword Density = (15/500)X 100
In earlier days, webmasters put keyword so many times to do better in Google or any other search engine. But these days modern search engine become smart enough to deal with those unhealthy pattern of seo technique. Some time writer modifies the article for concentrating keyword only and putting it again and again, and due to these the article sounds unnatural. This sort of things may lead to Keyword Stuffing, an unhealthy and unethical seo technique.
Matt Cutts of Google, tells in an question round that maximum use of keyword without article requirement can make the article unreal and it may harm you sites rank in Google.
So the moral of the story, as per Matt Cutts there is no hard and fast rule about the percentage of keyword density, it is the content that attract traffic an as search engine also. Put the words natural way and not because of search engine wants it. Best of Luck.