Keyword density is the value that indicates how often a keyword is found in a text or in a document. It is calculated from the frequency of the term being examined and the total number of words (see TF*IDF). “Term” here refers to keywords that can also consist of several words (word combinations). A text of 100 words in which the searched term occurs four times has a keyword density of four percent.
While Google used keyword density as a relevance criterion for the evaluation of websites in the early years, one can assume that this is not or hardly the case today because increasing the keyword density can also easily be done as part of spam, but at the expense of readability. According to the Google Webmaster Guidelines keyword stuffing is considered spam. Keyword stuffing would be the case if keywords are used in disproportionate numbers in the content of a website, which then results in a too high keyword density (from about eight percent). Google would then lower the relevant page in the ranking and send a message to the webmaster through the Google Search Console, providing the site is registered there.
The optimum keyword density is still being discussed and searched for in many forums. There is no consensus on it, but in many cases it is assumed that the value is between 5 - 8 percent. However, in text optimization keyword density should not play a major role. It is a lot more important to write an informative and content-relevant text, which is guaranteed added value for readers. Thus, the necessary keyword density can be achieved automatically by the natural occurrence of relevant terms. Moreover, attractive content ensures that users do not leave the page in question, thereby reducing the bounce rate and increase length of stay.
Although texts should no longer be optimized based on the frequency of keywords contained in it, the ratio should not be disregarded as many texts are improved in content, but are inadvertently stuffed with keywords which may cause too high keyword density. Rewriting or use of descriptions or synonyms is a good remedy. It is also important to note that perfect articles are not enough to achieve good rankings, but other content such as images or videos, and technical optimization, and since April 2015, mobile optimization are important quality factors for good websites.