Code Formatters — CSS, HTML, SQL & XML
One formatter covering the four languages that most often arrive as a single unreadable line.
1 tools · Reviewed by Mimamsa, Founder & Engineer, CodeLint.Dev
Minified CSS, machine-generated HTML, a SQL query pulled out of an application log, an XML payload from a SOAP endpoint — all four routinely reach you as one enormous line, and all four are painful to reason about in that state.
The formatter re-indents each of them according to that language’s conventions rather than applying one generic rule: SQL keywords are cased and clauses broken onto their own lines, HTML respects which elements are inline versus block, XML preserves attribute order, and CSS gets one declaration per line with consistent brace placement.
This is a formatter, not a linter — it will not tell you that a CSS property is misspelled or that a SQL query will be slow. It makes the structure visible so that you can see those things yourself.
Formatter
What formatting fixes, and what it does not
A formatter changes layout only. Knowing where the line falls saves reaching for the wrong tool:
| Problem | Formatting helps? | What you actually need |
|---|---|---|
| Minified CSS is unreadable | Yes | Formatting is exactly the fix |
| SQL query is one 400-character line | Yes | Clause-per-line layout makes the structure visible |
| HTML tags look mis-nested | Indirectly | Indentation reveals the mismatch; a validator confirms it |
| A CSS property has no effect | No | Specificity or a typo — use browser devtools |
| A SQL query is slow | No | Read the query plan with EXPLAIN |
| XML fails to parse | No | A malformed document will not format either — fix the syntax first |
| Output does not match the project style | No | Use the project’s own formatter, which has its own config |
Frequently asked questions
- Does formatting change what my code does?
- No. Formatting only alters whitespace between tokens. For CSS, HTML and XML that is never semantically significant outside of preformatted content, which is preserved. For SQL, whitespace between keywords is irrelevant to the parser, and string literals are never touched.
- Is my code uploaded anywhere?
- No. All four formatters run as JavaScript in your browser. Nothing you paste is transmitted, which matters when the SQL contains real table names or the config contains internal hostnames. The page also keeps working offline once loaded.
- Can it format minified JavaScript?
- JavaScript is not among the four languages here. Formatting minified JavaScript meaningfully requires a full parser and, for anything build-produced, a source map to recover the original names — your editor or a dedicated tool is a better fit.
- Which SQL dialects are supported?
- The formatter understands standard SQL along with the common dialect extensions — PostgreSQL, MySQL, SQLite, SQL Server and BigQuery among them. Dialect-specific syntax that it does not recognise is passed through unchanged rather than mangled.
- Can I use this on minified production CSS?
- Yes, and that is the most common use for it. Formatting a minified stylesheet will not restore the original comments or variable names — those are discarded at build time — but it does make selector structure and cascade order legible again.