(Nkr/Tkn)*100

Where, Nkr represents how many times a specific keyword is repeated, Tkn is the total words in the analyzed text. Taking the percentage gives the keyword density.