Suggestions appear as you type. Use the up and down arrows to choose one and Enter to open it.

This page's audience our own tag's counts — open to see them
–Visits
–Page views
–Clicks to vendors
–Time on page
–Reading now
Clicks to vendors, by tool
  • –
Top countries
  • –
Devices
  • –

– · visits, page views and clicks counted by our own tag, which counts more than our checked analytics; every figure rounded down · how we count

The Best Code Formatting Tools in 2026

We researched code formatting tools using official websites, including pricing pages, plan tables and product documentation. Products are ranked on their core formatting job, value for money and verified features, helping teams choose the right code formatting tools.

Our top picks

  1. Top ranked

    dprint#1 of 34
    9.4/10

    A broad, editor-friendly formatter for multilingual repositories and changed-file workflows.

    Open source

  2. Runner-up

    Prettier#2 of 34
    9.2/10

    A broad, open-source formatter for web-language teams across editors and workflows.

    Open source

  3. Top-ranked free plan

    clang-format#4 of 34
    8.9/10

    A flexible open-source formatter suited to C and C++ projects with broad workflow support.

    Free plan

Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.

The full ranking 34 tools, best first

34 tools
  1. dprint

    Best forTeams formatting many languages

    A broad, editor-friendly formatter for multilingual repositories and changed-file workflows.

    • Changed-lines formatting
    • Ignore files
    • Library API
    9.4/10★★★★★
    Visit dprint
  2. Prettier

    Best forWeb development teams

    A broad, open-source formatter for web-language teams across editors and workflows.

    • Ignore files
    • Library API
    • Editor integration
    9.2/10★★★★★
    Visit Prettier
  3. Spotless

    Best forJVM build-driven projects

    A build-focused formatter for JVM projects that need broad language coverage and automation.

    • Changed-lines formatting
    • Ignore files
    • Library API
    9.0/10★★★★☆
    Visit Spotless
  4. Best forC and C++ projects

    A flexible open-source formatter suited to C and C++ projects with broad workflow support.

    • Changed-lines formatting
    • Ignore files
    • Library API
    8.9/10★★★★☆
    Visit clang-format
  5. Biome

    Best forWeb teams wanting lint and format

    An open-source web toolchain combining formatting, linting, fixes, and editor support.

    8.8/10★★★★☆
    Visit Biome
  6. Black

    Best forPython formatting with stable conventions

    A focused open-source formatter for consistent Python style and smaller diffs.

    • Changed-lines formatting
    • Ignore files
    • Editor integration
    Free plan Our Black verdict → Visit Black
    8.7/10★★★★☆
    Visit Black
  7. Ruff

    Best forPython teams needing lint plus format

    A focused Python tool that combines formatting, linting, autofixes, and CI support.

    Free plan Our Ruff verdict → Visit Ruff
    8.6/10★★★★☆
    Visit Ruff
  8. Scalafmt

    Best forScala projects using build tools

    A configurable, open-source formatter for Scala code, scripts, and build files.

    • Changed-lines formatting
    • Ignore files
    • Library API
    8.5/10★★★★☆
    Visit Scalafmt
  9. CSharpier

    Best forC# teams across major IDEs

    Open-source C# and XML formatting with broad editor support and detailed configuration.

    • Ignore files
    • Library API
    • Editor integration
    8.4/10★★★★☆
    Visit CSharpier
  10. Best forPHP standards enforcement

    A configurable, open-source PHP formatter for local development and CI.

    • Changed-lines formatting
    • Ignore files
    • Library API
    8.3/10★★★★☆
    Visit PHP CS Fixer
  11. Best forJava teams following Google style

    A focused open-source formatter for consistent Google-style Java code.

    • Changed-lines formatting
    • Library API
    • Editor integration
    8.2/10★★★★☆
    Visit site
  12. shfmt

    Best forShell scripting teams

    A configurable open-source formatter for shell scripting teams and automated workflows.

    • Ignore files
    • Library API
    • Editor integration
    Open source Our shfmt verdict → Visit shfmt
    8.1/10★★★★☆
    Visit shfmt
  13. rustfmt

    Best forRust projects using Cargo

    A focused Rust formatter with Cargo, CI, configuration, and editor support.

    • Ignore files
    • Library API
    • Editor integration
    Open source Our rustfmt verdict → Visit rustfmt
    8.0/10★★★★☆
    Visit rustfmt
  14. Best forJavaScript and markup beautification

    A flexible, free formatter with broad language coverage and editor integrations.

    • Library API
    • Editor integration
    7.9/10★★★★☆
    Visit js-beautify
  15. goimports

    Best forGo teams needing import cleanup

    A focused Go formatter that cleans imports and supports editor save workflows.

    • Ignore files
    • Library API
    • Editor integration
    7.8/10★★★★☆
    Visit goimports
  16. gofmt

    Best forGo teams wanting canonical formatting

    Canonical Go formatting with recursive processing, rewrites, diffs, and editor integrations.

    • Library API
    • Editor integration
    Open source Our gofmt verdict → Visit gofmt
    7.7/10★★★★☆
    Visit gofmt
  17. yamlfmt

    Best forYAML-heavy repositories

    A configurable YAML formatter for recursive checks, CI workflows, and Go-based tooling.

    • Ignore files
    • Library API
    7.6/10★★★★☆
    Visit yamlfmt
  18. Best forDart and Flutter developers

    A free, open-source Dart formatter with CI checks and editor workflows.

    • Editor integration
    7.5/10★★★★☆
    Visit Dart formatter
  19. Best forSwift projects on Apple platforms

    A focused Swift formatter and linter for Apple-platform development workflows.

    • Library API
    • Editor integration
    7.4/10★★★★☆
    Visit swift-format
  20. Best forSQL and PostgreSQL developers

    A configurable open-source formatter for SQL and PostgreSQL workflows.

    7.3/10★★★★☆
    Visit pgFormatter
  21. Fantomas

    Best forF# developers using .NET IDEs

    A focused open-source formatter for F# projects across .NET editors and CI workflows.

    • Ignore files
    • Library API
    • Editor integration
    7.2/10★★★★☆
    Visit Fantomas
  22. Ormolu

    Best forHaskell teams wanting GHC parsing

    A focused GHC-based formatter for consistent Haskell code and CI checks.

    • Library API
    • Editor integration
    Open source Our Ormolu verdict → Visit Ormolu
    7.1/10★★★★☆
    Visit Ormolu
  23. Fourmolu

    Best forConfigurable Haskell formatting

    A focused Haskell formatter with YAML configuration, CI checks, and editor integration.

    • Library API
    • Editor integration
    7.0/10★★★★☆
    Visit Fourmolu
  24. Best forOCaml projects using Dune

    A configurable OCaml formatter with Dune, editor, RPC, and library integrations.

    • Ignore files
    • Library API
    • Editor integration
    6.9/10★★★☆☆
    Visit OCamlFormat
  25. Best forC-family projects needing deep control

    A free, open-source formatter for eight languages with deep rule control.

    • Editor integration
    6.8/10★★★☆☆
    Visit Uncrustify
  26. Best forElm developers

    A free, open-source Elm formatter with editor integrations and validation.

    • Library API
    • Editor integration
    6.7/10★★★☆☆
    Visit elm-format
  27. Taplo

    Best forTOML configuration files

    A focused TOML toolkit for formatting, validation, querying, and editor support.

    • Ignore files
    • Library API
    • Editor integration
    Free plan Our Taplo verdict → Visit Taplo
    6.6/10★★★☆☆
    Visit Taplo
  28. Best forLaravel PHP projects

    A focused open-source formatter for PHP and Laravel workflows on Linux.

    • Changed-lines formatting
    • Ignore files
    6.5/10★★★☆☆
    Visit Laravel Pint
  29. autopep8

    Best forBasic Python PEP 8 formatting

    A focused, configurable Python formatter for PEP 8 cleanup.

    • Changed-lines formatting
    • Ignore files
    • Library API
    6.4/10★★★☆☆
    Visit autopep8
  30. YAPF

    Best forTeams needing configurable Python formatting

    A flexible Python formatter with strong control over styles, diffs, and scope.

    • Changed-lines formatting
    • Ignore files
    • Library API
    Open source Our YAPF verdict → Visit YAPF
    6.3/10★★★☆☆
    Visit YAPF
  31. Zig fmt

    Best forCanonical Zig formatting

    A focused, open-source formatter for keeping Zig code in canonical form.

    • Editor integration
    6.2/10★★★☆☆
    Visit Zig fmt
  32. UglifyJS

    Best forJavaScript minification and beautification

    A focused open-source toolkit for JavaScript optimization in local build workflows.

    6.1/10★★★☆☆
    Visit UglifyJS
  33. Best forHaskell import and style cleanup

    A focused open-source formatter for Haskell imports, style rules, and source cleanup.

    • Library API
    • Editor integration
    6.0/10★★★☆☆
    Try stylish-haskell
  34. Avidemux

    Best forBasic video editing, not code formatting

    A free video editor, not a source-code formatting tool.

    6.0/10★★★☆☆
    Visit Avidemux

No tools match those filters.

Compare at a glance

#ToolFree planPaid fromSupported languagesSupported platformsEditor integrationIgnore filesScore
1dprintFreeTypeScript, JavaScript, JSX, TSX, JSON, JSONC, Markdown, TOML, CSS, SCSS, Sass, Less, Dockerfile, C#, VB, Python, Jupyter, Go, Swift, HTML, Vue, Svelte, Astro, Angular, Jinja, Twig, Nunjucks, Vento, GraphQL, YAML, PHP, Quarto, Pandoc, R Markdown, LaTeX, BibTeX, R, JuliaWindows, macOS, Linux, WSL, Node.js, DenoYesYes9.4
2PrettierFreeJavaScript, JSX, Angular, Vue, Flow, TypeScript, CSS, Less, SCSS, HTML, Ember/Handlebars, JSON, GraphQL, Markdown, GFM, MDX v1, YAML, LWC, MJMLBrowser and JavaScript APIYesYes9.2
3SpotlessFreeANTLR, C, C#, C++, CSS, Flow, GraphQL, Groovy, HTML, Java, JavaScript, JSON, JSX, Kotlin, Less, Markdown, Objective-C, Protobuf, Python, Scala, SCSS, Shell, SQL, TypeScript, Vue, YAML, Gherkin, Go, RDF, AnythingGradle, Maven, SBT, other build systemsYesYes9.0
4clang-formatYesFreeC, C++, Java, JavaScript, JSON, Objective-C, Protocol Buffers, C#, TableGen, TextProto, VerilogWindows, macOS, LinuxYesYes8.9
5BiomeYesFree8.8
6BlackYesFreePythonWindows, macOS, Linux, local HTTP APIYesYes8.7
7RuffYesFree8.6
8ScalafmtYesFreeScala 2, Scala 3, sbt, Scala scriptsCLI, editors, build tools, standalone libraryYesYes8.5
9CSharpierFreeC#, XMLWindows, macOS, LinuxYesYes8.4
10PHP CS FixerYesFreePHPYesYes8.3
11google-java-formatFreeJavaJVM command line; IntelliJ IDEA; Android Studio; Eclipse; Visual Studio CodeYes8.2
12shfmtFreePOSIX Shell, Bash, Zsh, mksh, and BatsLinux, Windows, macOSYesYes8.1
13rustfmtFreeRustWindows, macOS, Linux, APIYesYes8.0
14js-beautifyYesFreeJavaScript, JSON, React.js, HTML, CSS, SCSS, SASSWeb browser, Node.js, PythonYes7.9
15goimportsFreeGoweb, windows, macos, linuxYesYes7.8
16gofmtFreeGoWindows, macOS, LinuxYesNo7.7
17yamlfmtYesFreeYAMLWindows, macOS, LinuxYes7.6
18Dart formatterYesFreeDartWindows, macOS, LinuxYes7.5
19swift-formatFreeSwiftmacOS, iOSYes7.4
20pgFormatterYesFree7.3
21FantomasFreeF#web, self_hostedYesYes7.2
22OrmoluFreeHaskellLinux, macOS, Windows, webYes7.1
23FourmoluFreeHaskellweb, windowsYes7.0
24OCamlFormatYesFreeOCamlYesYes6.9
25UncrustifyYesFreeC, C++, C#, Objective-C, D, Java, Pawn, ValaLinux, OS X, WindowsYes6.8
26elm-formatYesFreeElmWindows, macOS, LinuxYes6.7
27TaploYesFreeTOMLLinux, macOS, Windows, Node.js, DockerYesYes6.6
28Laravel PintFreePHPlinuxYes6.5
29autopep8YesFreePythonOS independentNoYes6.4
30YAPFFreePythonWindows, macOS, LinuxYesYes6.3
31Zig fmtYesFreeZigWindows, macOS, LinuxYes6.2
32UglifyJSYesFree6.1
33stylish-haskellYesFreeHaskellWindows, LinuxYesNo6.0
34AvidemuxYesFree6.0

Head-to-head All 27 comparisons →

Explore other topics All topics →

How we rank code formatting tools

Every tool on this page was researched by iTechGuides Editors from its official website — pricing pages, plan tables and product documentation. We rank on how well each one does this category's core job, what the free or entry plan includes, and where it falls short. Where we have enough verified facts, the score out of 10 is a rubric — job fit, value and how much we could verify — shown with its breakdown on every tool's page; a tool we have not verified enough to score yet shows its rank without a number. Scores are re-checked when a product changes its plans. Read the full editorial policy, or submit a tool we missed.

Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026

Last updated · How we research and update