1 Any HTML 2 processed on your device 3 Indented or minified
HTML Minifier & Beautifier
Your HTML
Result
HTML
01
What it does
Minifies or indents HTML, leaving pre, textarea, script and style content exactly as it was.
Indent nested elements
Collapse whitespace without gluing words together
pre, textarea, script and style kept verbatim
Comments removed (conditional comments kept)
02
Private by design
Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.
03
What you get
Minified or indented HTML, with a Copy and a Download button on every result.
HTML
Minify
Format
Why it matters
HTML from CMS exports, email builders and old sites is often a single unreadable line or a mess of inconsistent indentation. Beautifying it makes it possible to find the bit you need to change.
Minifying HTML saves less than minifying CSS or JavaScript, but on large pages it still trims a few kilobytes. The risk is breaking spacing between inline words or inside pre blocks, which this tool is careful to avoid.
How it works
InputHTML markup
In your browserTokenised; pre, script and style left alone
OutputIndented or minified HTML with sizes
Where it fits in a designer's workflow
Plan
Design
Build
Test
Launch
Tidying exported HTML or squeezing a page before launch.
By the numbers
Measured by running this tool's own minifier on leej.uk's index.html at build time: 5% smaller raw, 2% smaller gzipped. The page is already tidy, so the saving is small; pre, textarea, script and style content is never touched.Show the numbers as a table
Version
Bytes
Gzipped
As shipped
53,692
10,782
Minified by this tool
51,089
10,515
How to use it
Paste your HTML.
Choose Minify or Beautify and the options.
Check the result and the size.
Copy or download it.
FAQ
Will minifying change how my page looks?
It shouldn't. Runs of spaces are collapsed to one space, which HTML treats the same, and pre and textarea keep their exact spacing.
Does it fix broken HTML?
No. It keeps your tags as they are. Run broken pages through the W3C validator to find errors.
Does it minify inline CSS and JavaScript?
No, they're kept exactly as written. Use the CSS Minifier for styles.
I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.