Update: I wrote a blog post about the process of building TV Sort. It goes into a lot more detail about the technical details of the project, as well as the design decisions I made. It also includes some of the challenges I faced, and how I solved them. I highly recommend you check it out.

TV Sort is a tool to help you find your favourite episode of a TV show. It uses a human-driven sorting algorithm to compare episodes against each other and find the best one.

I built this over Christmas 2023 while discussing the best episodes of Frasier with my family. It's hard to answer the question “what's your favourite episode?” because there are so many episodes, and so many of them are great. It's much easier to answer the question “which of these two episodes is better?” and then repeat that question a bunch of times until you have a sorted list.

If you have any questions, comments, or feedback, please tweet at me or send me an email.


TV Sort uses the TMDB API but is not endorsed or certified by TMDB. I use the TMDB API to search for TV shows and get the episode lists for those shows. I also use the TMDB API to get the poster images for each episode, as well as links to IMDB.

TMDB logo

Technical Details

TV Sort is open source and available on GitHub. It's built with Next.js. The source code is available under the AGPLv3 license.

TV Sort was heavily inspired by Leonid Shevtsov's MonkeySort algorithm, which I love and have used countless times for my own ad-hoc lists. The algorithm allows you to compare two items at a time and then uses that information to sort the entire list.

Your choices are saved in your browser's local storage, so you can come back to the list later and continue sorting, which is important, since most TV shows have -a lot- of episodes. Even the best sorting algorithm is going to take a while to sort 200 episodes, so you'll probably want to come back to it later.

Choices are also sent to the server, anonymously, so that I can build a database of episode rankings. This will allow us to build a list of the best episodes of a show, as ranked by all users, without the usual 1/10 or 5/5 star ratings that are typically used and mean different things to different people.

Built with 🩵 by PocketArC with data from TMDB · About · Twitter