Online Rust compiler
Compile and run Rust online free, no sign-up: write fn main(), give it input on stdin and see the output, compiler errors and run time in your browser.
How do I run Rust code online?
This is an online Rust compiler: write a program with fn main(), put its input in the Input box and press Run. It is compiled with rustc and run on the server, and you see the output, the borrow checker's and compiler's errors, or the panic, and the run time — free, with no sign-up.
How it works
- Write your program. A Rust program starts at fn main() and is compiled as a single file with the standard library only — there is no Cargo here, so crates such as rand or regex cannot be used.
- Give it input. Read everything with io::stdin().read_to_string(&mut input) (bring in std::io::Read), then walk input.lines() or input.split_whitespace() and parse with .parse::<i64>().unwrap(). Put every line the program reads in the Input box before you run it.
- Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.
Who it is for
Anyone writing Rust who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying Rust before setting it up.