Minify HTML — safely, locally
Reduce HTML file size by trimming whitespace and redundant attribute quotes while preserving the document semantics. Inline scripts are never executed during processing, and nothing is uploaded.
What this tool does
HTML minification here is deliberately conservative: whitespace and attribute-quote reductions that keep the parsed document identical, and nothing that could change behavior. Your page is text to this tool — its scripts are data, never code that runs.
After minifying, gzip the file for transfer or archival. The tool reports the real measured sizes for both steps.
How to minify an HTML file without uploading it
-
Add the file. Drop your .html into the home-page tool.
-
Minify. Safe whitespace and attribute-quote optimization runs locally; optionally gzip the result.
-
Download. Save the minified file and deploy or archive it as you like.
Supported operations
This list is generated from CompressKit's capability registry — only implemented and tested operations appear here.
-
Reduce file size
Safe minification preserving document semantics, plus optional gzip.
Frequently asked questions
- Can HTML minification break my page?
- This tool only removes whitespace and unnecessary attribute quotes — transformations that keep the parsed DOM identical. It deliberately avoids aggressive rewrites that could change rendering or behavior.
- Does my HTML get uploaded?
- No. The file is processed in your browser. Your markup, including any inline scripts, never leaves your device and is never executed.
- How much smaller does HTML get?
- Depends on how it was written: template-generated HTML with deep indentation can shrink a lot; already-compact markup only a little. The tool reports your file’s real numbers.
- Should I also gzip the minified file?
- For transfer or storage, yes — gzip on top of minification shrinks HTML much further. Use the gzip option in this tool.
Ready to try it?
The HTML compressor tool runs on this site with no upload step — your file is processed by your own browser and saved back to your device.
Open the HTML compressor tool