Type a tool name, for example "keyword density" or "transcript".
Conservative HTML tag-spacing compression. Text, scripts, styles and preformatted content are preserved. Maximum 2 MB per input, 5 files and 2 MB total per upload.
Minify and compress HTML code to reduce file size and improve load times.
This free HTML minifier shrinks your markup by tightening the spacing between tags, so each page carries fewer bytes and loads a little faster. Paste code or upload up to five .html or .htm files, then see the original size, the compressed size and the percentage saved, and copy or download the result.
HTML minification is the process of removing characters that browsers do not need to render a page, mainly extra spaces, tabs and line breaks between tags. The page looks the same to visitors, but the file is smaller.
Developers indent code so people can read it. A browser ignores most of that indentation, yet every space and newline is still a byte that must be downloaded. In a template with deeply nested lists, tables or navigation menus, indentation can make up a noticeable part of the file.
This tool uses conservative compression. It works on the spacing between tags and leaves text, scripts, styles and preformatted content alone. That matters because whitespace inside a pre block or a textarea is meaningful, and changing it would change what people see.
Minifying rewrites the file itself. Gzip and Brotli are applied by your web host when it sends the file, and they squeeze repeated patterns. The two stack, so minified HTML that is also compressed in transit is smaller than either step alone.
You can compress HTML by pasting code or by uploading files, and both paths take under a minute.
If you work in an editor such as Visual Studio Code, open the file, copy its contents and paste them into the box. Save the output under a new name so your readable source stays intact.
Say you paste a 48-line landing page template that is indented with four spaces and has a navigation list where each item sits on its own line. The tool reports an original size of 12.40 KB and a compressed size of 10.20 KB.
The saving is 12.40 minus 10.20, which is 2.20 KB. Divided by the original size, that is about 17.7%, shown as the percentage reduced. The text, inline styles and scripts in the output are the same as what you pasted. Only the gaps between tags are tighter.
Is 2.2 KB worth it? On one visit, barely. Across 100,000 page views, it is roughly 215 MB less data sent, before any host-level compression. The saving is small per page and meaningful at scale.
The percentage reduced tells you how much of the original file was spacing the browser did not need. What it means depends on how the file was written, as the table shows.
| Result | Likely cause | What to do |
|---|---|---|
| Large saving | Heavily indented template | Deploy the minified version |
| Small saving | Already compact, or mostly text | Look at images, CSS and scripts next |
| Almost no change | Content sits in preformatted or script blocks | Expected, since those are preserved |
After minifying, open the result in a browser and compare it with the original. If the layout matches, the output is ready to use. For uploads, a row that shows a message instead of sizes means that file was rejected, usually because of the wrong extension or because it went over the size limit.
HTML is often a small part of total page weight. Inline styles and scripts are kept as they are, so run stylesheets through the CSS Minifier and scripts through the JS Minifier for bigger wins.
Anyone who ships HTML to browsers can benefit, especially when pages are served in large volumes or on slow connections.
Minify as the last step before publishing, never as the first. Keep your readable source as the version you edit.
Minified markup is hard to edit by hand. If you need to read or change it later, run it through the HTML Formatter to restore indentation, or keep the source file and re-minify after each edit.
Open the minified page next to the original. Pay attention to places where spacing carries meaning, such as two inline links side by side, code samples and form fields. If something looks off, you can adjust the markup in the HTML Editor Online and compress again.
The compression is intentionally cautious, so savings will be smaller than with aggressive minifiers that rewrite attributes or drop optional tags. The tool focuses on spacing between tags and does not restructure your markup.
It also does not minify the CSS or JavaScript inside your page, does not optimize images, and does not replace gzip or Brotli on your host. Think of it as one safe, quick step in a wider speed checklist.
Ready to shrink your markup? Paste your code or upload your files above, check the percentage saved, and download the result. For more utilities like this, browse the web developer tools collection.
Your report has been submitted. We will look into this issue.
A VPN changes your network exit. It does not guarantee anonymity.
Themes, plugins, code, video, audio, graphics & more from 90,000+ authors.
Web Development
Design & Media
Unlimited Access
Explore Envato Market