Rust Code Formatter
Guide
Rust Code Formatter
Format your Rust code following official rustfmt conventions. Paste your code, configure formatting options, and get clean, consistently styled output matching cargo fmt standards.
How to Use
Paste your Rust code into the editor, select your preferred max line width (80, 100, or 120 characters) and Rust edition (2015, 2018, or 2021), then click Format. The formatted output appears with syntax highlighting, ready to copy or download as a .rs file.
Features
- Rustfmt Rules – 4-space indentation, trailing commas, consistent brace placement, and operator spacing
- Configurable Max Width – Choose 80, 100, or 120 character line width
- Edition Support – Format for Rust 2015, 2018, or 2021 edition
- Syntax Highlighting – Color-coded Rust code in both input and output
- Comment Preservation – Inline and block comments are kept intact
- Download as .rs – Save formatted code directly as a Rust source file
- Sample Code – Test with a pre-filled Rust example
Install Our Extensions
Add IO tools to your favorite browser for instant access and faster searching
恵 Scoreboard Has Arrived!
Scoreboard is a fun way to keep track of your games, all data is stored in your browser. More features are coming soon!
Must-Try Tools
View All New Arrivals
View AllUpdate: Our latest tool was added on Mar 10, 2026
