HTML Beautifier
Beautify HTML online for free — paste minified or messy HTML — including inline CSS and JavaScript and get clean, consistently indented code. Choose 2 spaces, 4 spaces or tabs, then copy or download. Powered by js-beautify; runs 100% in your browser.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Formatting uses the open-source js-beautify library and runs entirely in your browser, so private code is never uploaded.
How to beautify HTML
- Paste your HTML (or open a .html file).
- Pick the indentation you use.
- Click “Beautify” — pasting also formats automatically.
- Copy the formatted code or download it.
What you can use it for
- Make one-line HTML from a CMS or email builder readable
- Indent nested markup to spot unclosed tags
- Format HTML before editing templates
- Tidy code copied from DevTools or page source
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
How do I format HTML?
Paste the code and click “Beautify”. Indentation, line breaks and spacing are rebuilt consistently, without changing what the code does.
Is beautifying the opposite of minifying?
Yes. Minifying strips whitespace for production; beautifying adds it back so people can read it. To minify again, use our HTML Minifier.
Does it format CSS and JavaScript inside HTML?
Yes. Code inside <style> and <script> tags is formatted too.
Can I control line length?
Yes — choose to wrap long lines at 80 or 120 characters, or leave them unwrapped.
Is my code uploaded?
No. Formatting runs in your browser with the open-source js-beautify library, so private code never leaves your device.