Code & Formatting Tools
Format SQL, HTML, CSS, JavaScript and preview Markdown.
5 tools
SQL Formatter
Beautify messy SQL with clause-aware indentation, choose UPPER or lower keywords, and minify a query to a single line.
HTML Formatter
Re-indent HTML by nesting depth, keep inline elements flowing, and minify without corrupting pre and script content.
CSS Formatter
Give every CSS declaration its own line, indent nested at-rules, normalize hex colors and minify without corrupting strings.
JavaScript Formatter
Normalize JS indentation, spacing and brace layout - or minify it - while preserving your semicolons, quotes and structure.
Markdown Preview
Live Markdown preview with GFM tables, fenced code and nested lists - plus copy or download the generated HTML.
Popular Tasks
About Code & Formatting Tools
Code formatting is about removing noise from reading. A file where every block is indented, every statement breaks where you expect and every element sits at a consistent depth is faster to review, faster to diff and faster to search. The formatters in this category - SQL, HTML, CSS and JavaScript - normalize a messy file into that state without changing what it does.
Each formatter understands the structure of its language, not just the whitespace. The SQL formatter is clause-aware: SELECT, FROM, GROUP BY and ORDER BY go on their own lines and their items indent, WHERE conditions break at each AND or OR, and keyword case is a choice. The HTML formatter indents by nesting depth, keeps inline elements like spans flowing inside text, and preserves pre and script content byte-for-byte. The CSS formatter gives every declaration its own line, indents nested at-rules like @media and @keyframes, and can normalize hex colors. The JavaScript formatter expands blocks and object literals and spaces operators.
The honest limits are part of the design. These are tokenizing beautifiers, not compilers. A formatter can safely re-indent and re-space, but it should not add semicolons, convert quotes or move code around - that is where formatting starts changing behavior. The JavaScript formatter says this explicitly: if your code runs before formatting, it runs after.
Minification is the other half. Every formatter can switch to a compact single-line output that strips comments and whitespace, useful when a snippet has to fit in a request, a config string or a size limit. Preserved content - the inside of an HTML pre, a CSS string, a SQL string literal - stays intact so minifying never corrupts the output.
The Markdown preview is the read side of formatting. It renders the common Markdown subset to HTML live as you type, with GFM tables, fenced code and nested lists, and a raw-HTML toggle that escapes tags by default. Previewing is formatting for prose: it shows you what the reader will see.
All of it runs locally in the browser. Paste production SQL, a template with customer data or a private stylesheet; nothing is transmitted. Pick the formatter by the language, and use the mode switch to go from readable to compact and back.
Frequently Asked Questions
Will the formatter change my code?
No. These are whitespace formatters: they change indentation and spacing, not tokens. The JavaScript formatter in particular preserves semicolons, quotes and structure exactly.
What is the difference between format and minify?
Format produces the readable layout with indentation and line breaks. Minify strips whitespace and comments to produce the smallest output. Both produce equivalent code.
Does the HTML formatter preserve pre and script content?
Yes. The content of pre, textarea, script and style is preserved verbatim even in minified output, because reformatting it would change the rendered page.