Rust Formatter

Format Rust code with standard indentation.

Rust Formatter

.rs

Paste text or open a file to see the result.

What it does

Formats Rust with standard indentation and spacing, close to what rustfmt produces. Useful for snippets and examples you want to share or paste into a project. The code means the same, it is only laid out consistently.

About the .rs format

.RS file extension
File Type
Sun raster bitmap image file

The RS file extension is a file format that stores bitmap images and metadata.

Rust Formatter questions

How do I use the Rust Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .rs change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .rs page lists programs and converters for it.