Developer

Rust Formatter

Beautify & indent Rust source code.

This free Rust formatter tidies Rust source with consistent brace-based indentation, spacing around braces and after commas, and one statement per line. It's bracket-aware, so semicolons inside array types like[u8; 32] or macros like vec![1; 3] and commas inside generics or calls are left alone — only top-level statements split. Pick 2 or 4 spaces or a tab, format, then copy or download the result. It's a lightweight beautifier — it re-indents and spaces your code so it's readable, but it isn't the full rustfmt compiler, so it won't rewrap long expressions or enforce every style rule. String literals, chars and comments are preserved untouched.

Related tools