rustfmt
Input—per 1M tokens
Output—per 1M tokens
Context—tokens
WeightsClosed
About
rustfmt is ranked #6 of 34 in code formatting tools on Inferse. It runs on Linux, macOS, Windows. There is a free plan.
Compared on code formatting tools
- Supported languages
- Rustrust-lang.github.io
- Supported platforms
- Windows, macOS, Linux, APIrust-lang.github.io
- Editor integration
- Yesrust-lang.github.io
- Ignore files
- Yesrust-lang.github.io
- Changed-lines formatting
- Norust-lang.github.io
- Library API
- Yesrust-lang.github.io
- License model
- mixedrust-lang.github.io
Facts
- Purpose
- Rustfmt formats Rust code according to style guidelines.github.com · 2 Oct 2026
- Install
- The README says to install rustfmt on the stable toolchain with `rustup component add rustfmt`.github.com · 2 Oct 2026
- Cargo
- The `cargo fmt` command formats all binary and library targets in a crate and works with Cargo workspaces.github.com · 2 Oct 2026
- Input and output
- The rustfmt binary can format files or read Rust code from standard input and write formatted output to standard output.github.com · 2 Oct 2026
- Configuration
- Rustfmt accepts configuration in `rustfmt.toml` or `.rustfmt.toml`, with stable and nightly-only unstable options.github.com · 2 Oct 2026
- Editor integrations
- The README lists Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, IntelliJ, and CLion for running rustfmt from an editor.github.com · 2 Oct 2026
- CI use
- The README describes using `--check` in CI to report formatting differences through an error code.github.com · 2 Oct 2026
- Limit: comments
- Rustfmt does not currently attempt to format comments, though it formats code that contains comments.github.com · 2 Oct 2026
- Limit: macros
- The README says some macro declarations and uses are formatted, while macro declarations and uses are listed among rustfmt’s limitations.github.com · 2 Oct 2026
- Nightly options
- Unstable configuration options are available only on a nightly toolchain and require opt-in.github.com · 2 Oct 2026
- License
- Rustfmt is distributed under both the MIT License and Apache License 2.0.github.com · 2 Oct 2026
- Security contact
- The Rust Security Response Working Group handles vulnerability reports and security issues for rust-lang organization repositories.github.com · 2 Oct 2026
- Style stability
- The Rust Edition Guide describes a formatting stability guarantee intended to avoid noisy formatting changes when updating the Rust toolchain.doc.rust-lang.org · 2 Oct 2026
- Purpose
- rustfmt formats Rust code according to style guidelines.github.com · 3 Oct 2026
- Install
- The README installs rustfmt as a component through rustup.github.com · 3 Oct 2026
- Cargo
- The `cargo fmt` command formats binary and library targets in a crate and works with Cargo workspaces.github.com · 3 Oct 2026
- Direct use
- The rustfmt binary formats files in place or reads Rust code from standard input and writes formatted code to standard output.github.com · 3 Oct 2026
- Check mode
- With `--check`, rustfmt exits with code 0 when no formatting changes are needed and 1 when changes would be made.github.com · 3 Oct 2026
- Configuration
- Configuration can be set in `rustfmt.toml` or `.rustfmt.toml`, and the default style conforms to the Rust style guide.github.com · 3 Oct 2026
- Toolchains
- The README says rustfmt runs with Rust 1.24 and above, while the latest version requires the nightly toolchain.github.com · 3 Oct 2026
- Editor integrations
- The README lists integrations or usage instructions for Vim, Emacs, Sublime Text 3, Atom, Visual Studio Code, and IntelliJ or CLion.github.com · 3 Oct 2026
- CI
- The README describes using `cargo fmt --all -- --check` to fail a CI build when code is not formatted.github.com · 3 Oct 2026
- Limitations
- The README lists limitations involving unparsable code, macros, comments, code fragments, non-ASCII Unicode, and bugs.github.com · 3 Oct 2026
- Nightly options
- The README marks coverage, checkstyle, and JSON emit formats as nightly-only options.github.com · 3 Oct 2026
- License
- rustfmt is distributed under both the MIT License and Apache License 2.0.github.com · 3 Oct 2026
- IntelliJ and CLion
- The IntelliJ and CLion instructions describe enabling rustfmt on save or assigning a shortcut to reformat a file.github.com · 3 Oct 2026
- Support
- The README points users to `rustfmt --help` and `cargo fmt --help` for command usage and arguments.github.com · 3 Oct 2026
Best rustfmt alternatives
See all 12
7.3 autopep8 See plans price on the maker's page
7.2 pgFormatter Free free plan, no paid price published Free plan
7.2 Prettier Free free plan, no paid price published Free plan
6.0 Black Free free plan, no paid price published Free plan
6.0 clang-format See plans price on the maker's page
5.9 Accessibility Test Framework for Android Free free plan, no paid price published Free plan Where it ranks on Inferse
Sources
- github.com/rust-lang/rustfmt· checked 2 Oct 2026
- github.com/rust-lang/rustfmt/security· checked 2 Oct 2026
- doc.rust-lang.org/edition-guide/rust-2024/rustfmt-style-e· checked 2 Oct 2026
- github.com/rust-lang/rustfmt/blob/main/intellij.md· checked 3 Oct 2026
