Code Formatter
Format JSON, HTML, CSS, SQL, and Markdown. Note: for production-quality formatting, consider Prettier locally.
Deep Dive
A multi-language code formatter supporting JSON, HTML, CSS, SQL, and Markdown. Paste messy code and get properly indented, consistently styled output in one click using Prettier-compatible formatting rules. No code is sent to a server — formatting runs entirely in the browser.
Who uses this?
- Cleaning up HTML copied from a CMS or email builder
- Formatting a long SQL query for readability
- Standardising CSS before a code review
- Rendering a Markdown document to check its preview
Examples
Input
select id,name from users where active=1 order by nameOutput
SELECT
id,
name
FROM users
WHERE active = 1
ORDER BY nameCommon Errors & Fixes
Formatter does nothing to the input
Check that you selected the correct language tab. Formatting HTML as CSS (or vice versa) produces no output.
SQL formatter reorders clauses unexpectedly
The SQL formatter normalises clause order per SQL standards. Verify your query logic is preserved — it should be.
Expert FAQ
Which formatter is used under the hood?
The tool uses Prettier (for JS/HTML/CSS/Markdown) and sql-formatter for SQL, compiled to WebAssembly so everything runs in the browser.
Can I configure the indentation width?
Yes. Use the settings panel to set indent size (2 or 4 spaces, or tabs) and other style options.
Does it support JSX or TypeScript?
TypeScript and JSX formatting may be available under the 'JS/TS' tab. Check the language selector for the full list.