HTML Minifier

Compress pasted HTML snippets or local .html files in your browser with conservative options that preserve script, style, and whitespace-sensitive content by default.

Click to choose an HTML file or drop it here

You can also paste HTML directly into the editor below.

0 bytes

0 bytes

Pronto

Conservative defaults

The default preset removes ordinary whitespace and comments but keeps inline JavaScript, CSS, quotes, and whitespace-sensitive elements intact.

Snippet and file input

Paste partial HTML, full documents, malformed snippets, or load a local .html file before copying or downloading compressed output.

Size comparison

Compare original and minified byte counts before deciding whether the compressed HTML is worth using in your workflow.

Frequently asked questions

Is my HTML uploaded to Convertr?

No. The minifier runs locally with browser JavaScript. Pasted HTML and selected files are not sent to Convertr servers.

Why preserve script and style content by default?

Embedded JavaScript and CSS can be sensitive to rewriting. This tool focuses on HTML compression, so separate CSS and JS minifiers can be added later if needed.

When should I avoid removing optional tags?

Keep optional tags when comparing source, debugging unusual markup, or working with tools that expect explicit closing tags.