Code Formatters
Format JavaScript, TypeScript, HTML, CSS, Markdown and more with the same engines your editor uses — Prettier, clang-format, gofmt and Ruff — without installing anything. Paste minified or messy code, get consistently formatted output, and minify it again when you need to ship. Code never leaves your browser.
Common tasks
About code tools
Formattr uses the reference formatter for each language instead of a homemade one. JavaScript, TypeScript, HTML, CSS, SCSS, Less, Markdown, GraphQL, Java and PHP are formatted by Prettier and its official plugins; C and C++ by clang-format; Go by gofmt; and Python by Ruff, which produces Black-compatible output. That means the result matches what a pull-request check expects, so you can paste code into a review, a doc or a ticket without formatting noise.
Engines load only when you need them. The first time you format a language its engine is fetched from Formattr’s own origin and cached, so later runs are instant — even offline. Minify modes use Terser for JavaScript and CSSO for CSS, and report exactly how many bytes you saved.
Syntax errors show the line and column with the parser’s message, and the cursor jumps to the problem when you click it.
Frequently asked questions
Which Prettier version do you use?
Prettier 3 with its official plugins, loaded in your browser. Defaults match Prettier’s own defaults, and you can change print width, tab width, semicolons, quotes and trailing commas.
Why is the first format of a language slower?
Each language engine is loaded on first use to keep pages light. After that it is cached by your browser and works offline.
Can I format Rust?
Not yet. rustfmt has no stable browser build, and Formattr only ships formatters that run fully in your browser.
Does minifying change behaviour?
Terser and CSSO apply safe transformations by default. You can turn off name mangling or restructuring if you need output closer to the source.
More categories
- SQL FormattersMake SQL readable in the dialect you actually use. Formattr formats queries for Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server, Oracle PL/SQL, SQLite, BigQuery, Snowflake, Spark, Redshift and Trino, with your choice of keyword case, indentation and comma style — and minifies them back to one line when a config field or log needs it.
- Text FormattingClean up text copied from Word, PDFs, email and chat, and convert identifiers between naming styles. Remove invisible characters, extra spaces and broken line breaks; switch between camelCase, snake_case, kebab-case and Title Case; convert line endings; and strip Markdown down to plain text — all in your browser.