An analysis of Tolkien's books
About LotrProject

Lord of the Rings Project, commonly shortened LotrProject, is a creative web project run by Emil Johansson dedicated to the works of J.R.R. Tolkien. It is perhaps most known for the extensive and ever updating genealogy, the historical timeline of Middle-Earth and the statistics of the population of Middle-Earth.

General information

I have always been fascinated by data visualization, especially interactive. Analyzing the works of J.R.R. Tolkien felt very natural given my passion for the tales of Middle-Earth.

The analysis is based on the Silmarillion, the Hobbit and the Lord of the Rings trilogy. The fact that pages with illustrations have not been included means the page numbers may be slightly off. Since the index in the Silmarillion and the Appendices to the Lord of the Rings are not part of the narrative they have not been included.

The editions used in the analysis are:

The Silmarillion, 2011 edition, published by HarperCollins (ISBN: 0007173024)
The Hobbit, 2009 edition, published by HarperCollins (ISBN: 0395873460)
The Lord of the Ring, 2009 edition, published by HarperCollins (ISBN: 0261103253)

The books were first indexed in a database so that the data could be processed more easily. The information on this site has been derived without copying the entire work but only indexing it. Together with the fact that this site generates no money it is my belief that this is fair use. The indexing has also been done so that the character mentions and words can only be tied to a page and not a sentence or paragraph. This makes it impossible to reconstruct the books only from the information in the database.

Sentiment analysis

Sentiment analysis is the science of assigning mood to pieces of text based on keywords and structure. On the web this kind of research is most commonly used in social media. In this project I decided to apply it to Tolkien's works to see I could find patterns. Since sentiment analysis is rather difficult I used an free API called Sentiment140 created by three Computer Science graduate students at Stanford University: Alec Go, Richa Bhayani, and Lei Huang. While their algorithm was originally designed for Twitter it can be applied to regular texts as well.

Character Co-occurrence

In order to visualize connections between characters I created a force directed network graph for each book. The volumes in the Lord of the Rings was treated together to give better insight into the story.

The bubbles represent their total number of mentions across the book. In order for minor characters not to disappear completely I set both a maximum and a minimum possible size of the bubbles. The lines between two bubbles represent the total number of times both characters were mentioned on the same page.

This method for calculating character interactions is not completely optimal since characters are often mentioned on the same page even though they never meet. In the future I may develop a better approach to this. However, I believe these visualizations show interesting patterns in the narrative nonetheless. As an example the graph of Silmarillion clearly shows how big impact Melkor / Morgoth had on almost every part of the story.

A note on browser compatibility

This website uses a lot of exciting web technology and heavy rendering which unfortunately is not supported by many older web browsers. I would naturally love to support every web browser available but due to time constraints and limited testing possibilities I cannot. My advice is to update your existing browser to the latest version.

If you spot any bugs, please let me know at
A note on software used

This website has been built with a combination of jQuery, Flot and D3.js.

Written about this work

An Interactive Analysis of Tolkien's works by The Tolkienist
An incredibly thorough analysis of how frequently words and characters appear in J.R.R. Tolkien's books by io9

Interesting similar work

Analysis of Les Miserables by Jeff Clark
Word frequency in the Bible and the Quran by Pitch Interactive
Sentiment analysis of the Bible by OpenBible

My TEDTalk