Skip to the tool
DevToolBench

Code & SQL formatters

Beautify or minify CSS, HTML and SQL, render Markdown as HTML and build Markdown tables, with the dialect rules that make generic formatters fail.

A formatter earns its place only if the output means exactly what the input meant. That sounds trivial until whitespace turns out to matter — inside a pre block, between two inline elements, inside a string literal in a query. Every tool in this group is built around that constraint, and each page states where its limits are, so you know when to trust it with production code.

For stylesheets, the CSS beautifier puts one declaration per line, which turns a minified bundle into something you can read and diff. The CSS minifier goes the other way, stripping comments and whitespace while keeping strings, url() values, attribute selectors and custom properties exactly as written — the places where a regex-based minifier quietly changes behaviour. The HTML formatter indents or compacts markup but only adds or removes whitespace next to block elements, and copies pre, textarea, script and style through byte for byte, because reindenting those changes what the browser shows.

SQL is where a generic formatter fails most visibly, because every database has its own syntax at the edges. Use the SQL formatter for standard SQL, or when a query needs minifying onto one line for a log or a config value. Switch to the MySQL formatter when the query uses backtick-quoted identifiers or # comments, and to the PostgreSQL formatter for dollar-quoted function bodies and :: casts, which a standard tokenizer tends to split in the wrong place. All three leave the inside of strings and comments untouched; a dollar-quoted function body is a string to PostgreSQL, so format it as its own query and paste it back.

Markdown belongs here because most documentation is written in it before it becomes HTML. Markdown to HTML renders a declared CommonMark subset, plus GFM tables behind a toggle, and lists what it leaves out — footnotes and reference-style links among them — so check that list before feeding it a long README. The Markdown table generator builds aligned tables from a grid or from pasted CSV, which saves counting pipes by hand when one cell is wider than its header.