These coding games cover plenty of languages, age ranges, and skill levels, so whether you’re a complete beginner or looking for something on the next level, there’s a game out there to help you learn coding the best way: by doing it.

1. Code Combat

Code Combat is a coding lesson wrapped up in a medieval RPG and is designed to get you familiar with programming concepts like variables, methods, objects, and more. It manages to keep the basics fairly interesting, but the gameplay isn’t much to write home about: you can’t skip levels, and there’s some divide between the skills you learn here and real-world applications. If you want a friendly introduction to code that feels like less work than a beginner-level course, Code Combat is great. If you already have some programming experience, though, grinding through the early levels to get to new concepts may bore you. It’s probably better for getting into the “think like a programmer” mindset than for learning real-world development skills.

Best for: Beginners, kids Languages: Python, JavaScript, HTML, CSS

2. Ruby Warrior

Ruby probably isn’t the most relevant language to learn anymore, but this coding game might be worth a shot anyway! Ruby Warrior is a 2D side-scroller that lets you control your character using Ruby and general programming logic. It tosses you right in, letting you learn as you go, and does a great job of being informative, simple, and fun. Whether or not you need to learn Ruby, the game is both cute and fairly challenging.

Best for: Advanced beginners/intermediate Languages: Ruby on Rails

3. CodinGame

CodinGame is essentially a puzzle repository with a focus on algorithms and problem-solving using code. The fun/gaming aspect is definitely there (more in some puzzles than others, admittedly), but your brain may start to overheat as you work your way through some of these challenges. They can get pretty rigorous and require some complex thinking and programming expertise to get through. The material covers a wide range of programming languages and difficulties, but CodinGame probably isn’t a good place to start as a beginner. Even the easy tasks assume some familiarity with code and algorithmic thinking.

Best for: intermediate to advanced coders Languages: C, C#, C++, Java, JavaScript, Python3, Bash, C, Go, Ruby, Rust, Swift, PHP, and more

4. CodeGym

CodeGym is more a course than a game, but there’s a pretty serious story element included. Their goal is to get you from close to zero to junior Java developer using story-driven challenges and projects that you can do in the IntelliJ IDE (Integrated Development Environment), which is a great introduction to the coding tools you’ll be using later. You’ll have to pay for some parts of the course, but the free content gives you a good taste of whether or not the course will fit your Java journey.

Best for: Beginners+ Languages: Java

5. CheckiO

The “game” part of this is actually a pretty thin shell layered on top of a series of coding challenges and documentation, and you might find yourself wondering, “Wait, when does the game start?” for a while after you start playing around with CheckiO. That said, the coding challenges could certainly be helpful for anyone with some prior coding knowledge, and the whole hopping between different coding islands theme brings some color to the experience.

Best for: learning Python or JavaScript Languages: Python, JavaScript

6. Elevator Saga

If you already know a decent amount about JavaScript and are looking for some interesting problems to solve to keep your skills sharp, Elevator Saga could be fun. The idea is pretty simple: you have to give an elevator rules for travelling to different floors, picking people up, and dropping them off. It gets complicated fast, though, so you may find yourself quitting and coming back to it a few times.

Best for: practicing JavaScript Languages: JavaScript

7. Untrusted

While it’s written for JavaScript ES5, Untrusted still holds up as a very cool way to put your intermediate or advanced JavaScript skills to good use. It’s a text adventure where the plot revolves around you needing to hack your way out of a sticky situation by changing the code your captors are using against you. It’s a fun device that makes the code seem like a natural part of the story. It’s not for beginners and won’t teach you the most up-to-date JavaScript, but it’s a fun challenge!

Best for: practicing JavaScript Languages: JavaScript

Other resources

Some sites didn’t make the above list because they either weren’t quite game-like enough, don’t exactly teach code, cost money, focus on young learners, or are targeted specifically to pretty advanced coders, but they deserve a mention here nonetheless!

Screeps CodeWars Edabit Schemaverse Robocode VIM Adventures CryptoZombies CodeMonkey TIS-100 Hack ‘n’ Slash Cyber-Dojo

All these coding games can do is help you practice, though. Ultimately, being a coder is about going out and building your own things. Using sites like CodinGame and Codewars can help you keep your skills honed and growing, but after you’ve learned basic syntax, building progressively bigger projects is the best way to keep learning.