HTML, CSS and JavaScript formatter
Turn messy or minified code into clean, indented code, or shrink it for production. Works for HTML, CSS and JavaScript, right in your browser.
How to use it
- Paste your code. The language is detected, or pick it yourself.
- Select Beautify for readable code, or Minify for the smallest size.
- Copy the result or download it.
Questions
What does each button do?
Beautify adds consistent indentation and line breaks with js-beautify. Minify removes comments and extra whitespace: CSS with csso, JavaScript with terser (which also shortens variable names), and HTML with a careful routine that leaves pre, textarea, script and style blocks untouched.
Can minifying break my HTML?
The HTML minifier is deliberately conservative, but removing whitespace between tags can change spacing between inline elements such as links or buttons placed side by side. Check the result before shipping it.
Is my code uploaded or saved anywhere?
No. Everything runs in your browser. Your code is never sent to a server. A draft is kept in this browser only. Share links carry the code inside the link itself, after the # sign, which browsers never send to a server.
Also free and private: Markdown Preview and Private PDF tools.