HTML beautifier
Indent and tidy messy or minified HTML code.
About this tool
This tool re-indents HTML so nested tags are easy to follow, and also formats CSS inside <style> and JavaScript inside <script>. Paste minified page source or copied markup and choose 2 spaces, 4 spaces or tabs.
At a glance
- What it does
- Indent and tidy messy or minified HTML code.
- Price
- Free, no sign-up
- Works in
- Your browser, on phone or computer. Works offline after the first visit.
- Privacy
- What you type never leaves your device.
How to beautify HTML
- Paste your HTML or open an .html file.
- Choose the indent size.
- Copy the formatted HTML or download it.
Private
Your text stays in your browser and is never sent to a server.
Instant
Results update as you type, with nothing to install.
Free
No sign-up, no limits and no ads inside your writing space.
Frequently asked questions
Will beautifying change how my page looks?
Normally no. Only whitespace between tags changes. In rare cases whitespace between inline elements (like two <span>s) matters, so check text that must sit tightly together.
Does it fix broken HTML?
No. It formats what you give it and does not add missing closing tags. Unclosed tags usually show up as indentation that never steps back.
Is there an HTML minifier?
Not here: minifying HTML safely depends on <pre>, inline elements and scripts, so we left it out rather than risk breaking pages. For CSS, use the minify option in the CSS beautifier.
Is my text sent anywhere?
No. Everything runs in your browser and your text never leaves your device. Nothing is stored on any server.



