Learn Rust Programming

Welcome to learnrust.net. These free tutorials teach the Rust programming language from first principles, one short lesson at a time. No prior programming experience is assumed. Work through the chapters in order, or jump to a topic below.

More about these tutorials

These free tutorials teach you how to program in the Rust programming language from first principles. Unlike many other resources, these lessons are written for complete beginners and assume no prior programming experience at all: every concept is introduced step by step, explained in plain language, and demonstrated with complete example programs, each one verified to compile and run exactly as shown. Quizzes throughout let you check that an idea stuck before the next lesson builds on it. Whether you are writing your first line of code or coming to Rust from another language, you can learn Rust here at your own pace, entirely in your browser, with nothing to sign up for and nothing to pay.

Rust is a modern systems programming language used to build everything from command-line tools and web servers to operating systems and game engines. It is known for catching entire categories of bugs at compile time, which makes it an unusually good teacher: the compiler explains what went wrong and often suggests how to fix it. These tutorials lean into that strength, showing you not just what correct code looks like, but how to read the error messages you will inevitably encounter and what they are telling you about your program.

The chapters below are designed to be read in order, as each lesson builds on the ones before it. The pacing is deliberate: you will be writing complete, useful programs for several chapters before ownership and borrowing arrive, so Rust's famously hard ideas land on solid footing rather than on page one. The format is modeled on learncpp.com, the long-running C++ tutorial site, so if you have studied there the structure will feel familiar. Each lesson ends with links to the previous and next lessons, so you can move through the course without returning to this page. New lessons are added regularly, and existing ones are revised as the language evolves.

Chapter 0 Introduction / Getting Started
Chapter 1 Rust Basics
Chapter 2 Functions
Chapter 3 Debugging Rust Programs
Chapter 4 Fundamental Data Types
Chapter 5 Constants, Shadowing, and Strings
Chapter 6 Operators
Chapter 7 Control Flow
Chapter 8 Ownership and Moves
Chapter 9 References and Borrowing