HTML / CSS / JS / SQL Formatter
Paste minified or badly indented code, choose the language and format it into a readable structure with one click. It works the other way too: collapse code onto a single line to shrink payloads or squeeze it into a config value.
Formatting happens in the browser and your source is never uploaded, so it is safe for internal code snippets.
Features
- Multiple Languages — HTML, CSS, JavaScript, XML and SQL, the five formats you need most often.
- Format & Minify — Expand code into readable indentation, or compress it into a compact single line.
- Indentation Choice — 2 spaces, 4 spaces or tabs, matching whatever your project uses.
- Size Comparison — Shows the size before and after minifying so you can judge the saving.
- Sample Data — Built-in samples let you try it out without hunting for a snippet first.
How to use
- Paste the code you want to process on the left.
- Choose the language on the right: HTML, CSS, JavaScript, SQL or XML.
- Pick an indentation style and click Format or Minify.
- Review the output in the result panel and click Copy.
FAQ
Does formatting change how my code behaves?
For HTML, CSS, XML and SQL, formatting only adjusts whitespace and leaves semantics untouched. JavaScript deserves more care because of automatic semicolon insertion: joining two lines or moving a line break can change statement boundaries in a few rare constructs, so give the result a quick read afterwards.
Can minified code be restored?
Whitespace-only minification can be undone by formatting again, but optimisations such as variable renaming and dead code elimination are irreversible. This tool only removes whitespace and never renames identifiers.
Which SQL dialects does the formatter support?
It applies generic keyword casing and indentation, which handles the common syntax of MySQL, PostgreSQL and SQL Server. Dialect-specific constructs, such as certain stored procedure bodies, may not lay out perfectly.
Is my code uploaded?
No. All formatting is done locally in the browser and your code is never sent to a server.