HTML Minifier
This tool removes conservative amounts of formatting whitespace from small HTML snippets so you can inspect a compact representation without sending the markup to a server.
Minify simple HTML while preserving visible text
Paste small HTML and remove safe whitespace between tags or choose readable formatting.
Processing mode: browser-only for this tool. The interface does not require a server upload to perform its transformation.
Start with a focused browser tool
This tool removes conservative amounts of formatting whitespace from small HTML snippets so you can inspect a compact representation without sending the markup to a server.
Designed for: Frontend developers, technical writers, and site owners inspecting small HTML snippets.
How to use this tool
Paste a fragment or document. Conservative minify removes comments and whitespace between tags while keeping text content between tags. Readable format adds line breaks between tags for inspection.
How the result is produced
The browser applies regular-expression transformations intended for simple markup. It does not parse the input into a complete HTML document tree, which is why the page labels the output conservative.
Test examples
<div>\n <p>Hello</p>\n</div> becomes <div><p>Hello</p></div> under the conservative rule. Whitespace inside a text node is not treated as disposable.
Limitations
Do not use this as a production build pipeline. It may be unsuitable for preformatted text, inline scripts, inline styles, conditional comments, or markup where whitespace is meaningful. Always validate the result in the target browser.
Privacy and processing
The HTML is transformed locally in the browser and is not sent to the Nofyi server.
Related guide
When HTML whitespace matters and when it does not
Related tools in this category
Documentation
- https://html.spec.whatwg.org/multipage/syntax.html
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
This page describes the implementation shipped with the NOFYI Tool Factory. Review the interface output before using it in a production workflow.