HTML Minifier & Beautifier
Format or compact your HTML with a local parser. Your code stays in this tab and is never executed or saved.
Leave whitespace collapse off for CSS white-space layouts or templates. Scripts, styles, pre, code and textarea content are preserved when minifying. Beautifying can change indentation and rendered whitespace.
Paste code or load an example to begin. Up to 250,000 characters; 8-second processing limit.
Safe structure preview
Preview shows sanitized markup only. Scripts, styles, images, links and embedded content are blocked. This is not a full website preview.
Using HTML Minifier & Beautifier
Process markup without executing it. Conservative whitespace collapse keeps separator spaces and protected content; switch it off for whitespace-sensitive layouts.
- Paste HTML, open a UTF-8 file or load the example.
- Choose Minify or Beautify. Remove comments or collapse text whitespace only when suitable for your document.
- Review the output and byte sizes, then copy or download. Expand the safe structure preview if useful.
Example
<p>Hello <b>world</b> !</p> Whitespace collapse retains spaces between inline words. Leave collapse off for CSS white-space layouts.
Questions & answers
Does the preview run my JavaScript?
No. It shows a restricted, sanitized structure in a sandbox. Scripts, styles, images, links and embedded content are blocked. Exported code preserves source markup and can still be executable when opened elsewhere.
Are scripts and preformatted sections minified?
No. Minification leaves script, style, pre, code and textarea content intact. Use the dedicated JavaScript or CSS tool for those languages.
Can changing whitespace affect the page?
Yes. Optional collapse can change CSS white-space layouts and templates. Beautifying adds formatting whitespace. Review the output in your real layout before replacing the source.
Are my code and files saved?
No. Processing runs in a local worker, with an eight-second deadline and 250,000-character input limit. This version does not restore old saved drafts.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
