Prettier is a free, open-source code formatter that parses code and prints it in a consistent style, taking line length into account.
Best Code Formatters in 2026
Code formatters rewrite source code into a consistent style, helping you read and maintain projects with fewer manual edits. This category includes tools such as autopep8, Black, clang-format and google-java-format. For Xiaomi, Redmi or POCO phones or tablets, first look for an Android app; then review each formatter’s languages, licence, price and delivery options, including Linux, macOS, Windows, self-hosting,…
rustfmt is a free, open-source formatter for Rust code.
Black is a Python code formatter that applies a consistent style while following PEP 8.
- 4

Ruff
Ruff is a free Python linter and code formatter written in Rust.
Free planWebLinuxmacOSSelf-hosted6.6Free plan - 5
Uncrustify
Uncrustify is a free, open-source source code formatter for C, C++, C#, Objective-C, D, Java, Pawn, and Vala.
Free planLinuxmacOSSelf-hostedWindows6.4Free plan - 6
swift-format
swift-format is a free, Apache-2.0 licensed tool for formatting and linting Swift source code.
Free planiOSLinuxmacOS6.3Free plan - 7
Spotless
Spotless formats source code and can check files for formatting violations or apply fixes.
Free planLinuxmacOSWindows6.2Free plan - 8

CSharpier
CSharpier is a free, open-source formatter that parses C# and XML code and reprints it according to its own formatting rules.
Free planAPILinuxmacOSWindows6.1Free plan - 9
elm-format
elm-format is a free formatter for Elm source code, applying rules based on the official Elm Style Guide.
Free planLinuxmacOSWindows6.1Free plan - 10
gofmt
gofmt is the Go source formatter included with Go installations, available on Linux, macOS, and Windows.
Free planLinuxmacOSWindows6.1Free plan - 11

RuboCop
Free planLinuxSelf-hosted6.0Free plan - 12
Deno
Free plan5.9From $20 a month - 13
PHP CS Fixer
PHP CS Fixer is a free Linux and self-hosted tool that detects PHP coding-standard problems and fixes them automatically.
Free planLinuxSelf-hosted5.9Free plan - 14
OCamlFormat
Free planLinux5.8Free plan - 15
clang-format
clang-format is a free, open-source set of tools for formatting source code, available as a standalone command-line program and through editor integrations.
ExtensionLinuxmacOSWindows5.6 - 16
autopep8
APILinuxmacOSWindows5.5 - 17
Dart formatter
LinuxmacOSWindows4.8 - 18
YAPF
LinuxmacOSWindows4.8 - 194.4
- 20
EditorConfig
EditorConfig
4.3 - 21
LuaFormatter
Koihik
4.3 - 22
StyLua
JohnnyMorganz
4.3
Choosing well
Check Android support first
Look for a documented Android app before choosing a formatter for a phone or tablet. The platform facts listed here do not confirm Android support for any particular tool.
If there is no Android app, plan to use a supported desktop, hosted, API or extension workflow instead.
Match the formatter to your code
Product pages identify supported languages: google-java-format handles Java, and the category names Dart formatter, gofmt, LuaFormatter and OCamlFormat.
Compare free and paid plans
Several listed tools include a free plan, and some provide trials. Deno lists Pro at $20 per month alongside its Free plan.
Read the plan details before signing up so the price and limits fit your workflow.
Review the licence
Some entries publish their source code. When modifying a formatter, review the licence and contribution rules first.
Choose where it runs
You can find these tools as Linux, macOS or Windows software, self-hosted services, APIs or extensions. Pick the form that matches your editor, build process or server setup.
Questions people ask
Do these code formatters have Android apps?
The supplied facts do not confirm Android support for individual tools. Check the product page for an Android app before choosing one for a Xiaomi, Redmi or POCO device.
Can I use a free code formatter?
Yes—entries on this list include free plans. Deno also lists a Free plan alongside its $20-a-month Pro plan.
Are open-source formatters available?
Yes, some listed formatters publish open-source code. Review the licence if you plan to modify or redistribute code.
Where can these formatters run?
Listed choices span Linux, macOS and Windows, plus self-hosted services, APIs and extensions.
Does google-java-format support Java?
Yes. Java appears among google-java-format’s supported languages.
