You are offline. Tools you have opened before keep working.
HTML minifier
Make HTML smaller by removing comments and unnecessary whitespace. Inline styles and scripts are minified too, while text that depends on spacing stays intact.
Free and private. Everything runs in your browser, nothing is uploaded.
HTML
HTML
Report a problem
How it works
Paste your HTMLPaste the code, type it or open a file. Try Sample to see an example.
Check the resultThe result appears on the right as you type. Errors are shown with the line and column.
Copy or downloadCopy the HTML with one click or download it as a file.
Smaller pages, same result
Whitespace between block elements is removed, runs of spaces inside text become one, and comments disappear. Spaces that matter, such as the one between two links in a sentence, are kept.
Conditional comments and the content of pre and textarea are left untouched.
Minify a copy and keep the readable original for editing, so future changes stay easy.
About HTML
HTML describes the structure of web pages. The formatter knows which tags are blocks and which are inline, keeps pre and textarea content exactly as it is and formats scripts and styles inside the page too.
Frequently asked questions
How much smaller will my HTML get?
Typically 10 to 25 percent for hand written pages. Server compression such as gzip still applies on top.
Is my code uploaded anywhere?
No. Formatting and minifying run in your browser. Your code is not sent to our servers.
Does minifying rename my variables?
No. Minifying removes comments, line breaks and spaces only. Names stay readable and the code behaves exactly the same, which makes it safe for any file.
Why are some line breaks kept in minified JavaScript?
JavaScript treats some line breaks as the end of a statement. Where removing one could change what the code does, it is kept.
Can I format JSON here?
JSON has its own tool with a tree view and validation. Use the JSON Tools page linked below.
Does it work offline?
Yes. After you open the page once, it keeps working without an internet connection.