Don't like ads? Go Ad-Free Today

Rust Code Formatter

DeveloperText
ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?

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

ADVERTISEMENT · REMOVE?
Want To enjoy an ad-free experience? Go Ad-Free Today

Install Our Extensions

Add IO tools to your favorite browser for instant access and faster searching

Add to Chrome Extension Add to Edge Extension Add to Firefox Extension Add to Opera Extension

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!

ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?

News Corner w/ Tech Highlights

Get Involved

Help us continue providing valuable free tools

Buy me a coffee
ADVERTISEMENT · REMOVE?