Free · Fast · Privacy-first

Compress HTML File Online

Compressing an HTML file means stripping everything unnecessary: whitespace, comments, empty lines, and redundant attributes.

Free • Fast • Privacy-first

HTML Minifier

Compress HTML code instantly with our free online HTML minifier tool

Our free HTML minifier tool helps you minify HTML online by removing unnecessary whitespace and comments. Compress HTML file size by up to 60%, speed up page load times, and improve Core Web Vitals for better SEO performance. Works instantly in your browser—no download required.

Output
Minified HTML
Mode
In-browser
Time
Seconds
Price
Free

Lightning Fast

Process files instantly in your browser. No waiting, no delays.

🔒

100% Private

Everything runs locally. Your code never leaves your device.

Zero Configuration

Works instantly out of the box. No setup or installation required.

Trusted by developers worldwide

Minify HTML online

Paste your HTML, choose options, and get a compact output you can copy or download.

Demo fetch uses a CORS-friendly approach only if the target allows it.

Privacy-first

This page processes content locally in your browser (no upload).

What is HTML Minification?

HTML minification is the process of removing unnecessary characters from HTML code without changing its functionality. This includes eliminating whitespace, line breaks, comments, and other redundant elements that make code more readable for humans but aren't required for browsers to render the page correctly.

When you write HTML code, you typically format it with indentation, spaces, and line breaks to make it easier to read and maintain. While these formatting choices help developers understand the code structure, web browsers don't need this extra spacing to display the page. A free HTML minifier tool like this one strips away these unnecessary characters, resulting in a smaller file size that loads faster. This online HTML formatter tool allows you to minify HTML without installing any software—everything runs in your browser.

AspectFormatted HTMLMinified HTML
ReadabilityExcellent (Indented, Commented)Poor (Compressed, Single Line)
File SizeLarger (Whitespace Overhead)Smaller (40-60% Reduction)
UsageDevelopment & DebuggingProduction Deployment
Load TimeSlower (More Data Transfer)Faster (Optimized Transfer)
SEO ImpactNeutralPositive (Better Core Web Vitals)

Before Minification

<!DOCTYPE html>
<html>
  <head>
    <title>Example</title>
  </head>
  <body>
    <!-- Main content -->
    <div class="container">
      <h1>  Hello World  </h1>
      <p>   Welcome   </p>
    </div>
  </body>
</html>

File size: ~250 bytes

After Minification

<!DOCTYPE html><html><head><title>Example</title></head><body><div class="container"><h1>Hello World</h1><p>Welcome</p></div></body></html>

File size: ~140 bytes (44% smaller)

What Gets Removed During Minification?

  • Whitespace: Extra spaces, tabs, and line breaks between HTML tags
  • HTML Comments: Developer notes wrapped in <!-- --> tags
  • Empty Attributes: Redundant or default attribute values
  • Unnecessary Quotes: Optional quotes around certain attribute values (when safe)

The result is a compact, streamlined HTML file that maintains 100% functionality while consuming less bandwidth and loading faster. This optimization technique is especially valuable for high-traffic websites where even small file size reductions can translate to significant bandwidth savings and improved user experience.

Modern web development workflows often include HTML minification as an automated step in the build process. However, online HTML formatter tools like this free HTML minifier provide a quick way to beautify HTML code online for smaller projects, testing, or one-off optimizations without requiring build tool configuration. Whether you need to minify HTML for production deployment, compress HTML file sizes, or format HTML with indentation for readability, this HTML minifier browser tool delivers instant results. You can also use our HTML Formatter to beautify code before minifying, or our HTML Validator to check syntax before optimization.

HTML Minification Impact

Real data showing the performance benefits of minifying HTML code

40-60%
Average File Size Reduction
Typical savings from minification
0.3-0.7s
Faster Page Load Time
Improvement on 3G networks
15-25%
Core Web Vitals Boost
Improvement in LCP & FCP
30%
Bandwidth Savings
Reduced server costs
📊

Performance Benchmark

According to Google's Web.dev, a 0.1 second improvement in load time can increase conversion rates by up to 8%. By reducing HTML file size through minification, you directly improve page speed metrics that Google uses for search rankings.

Why Minify HTML?

Minifying HTML offers significant advantages for website performance, user experience, and search engine optimization. Here's why you should make HTML minification part of your optimization workflow:

Faster Page Load Speed

Smaller HTML files transfer faster over the network. Every kilobyte saved means quicker time-to-first-byte and faster rendering. This is especially critical for mobile users on slower connections where every millisecond counts. Studies show that 53% of mobile users abandon sites that take longer than 3 seconds to load.

🎯

Improved SEO Rankings

Google considers page speed as a ranking factor. Minified HTML improves Core Web Vitals metrics like First Contentful Paint (FCP) and Largest Contentful Paint (LCP). Better performance signals to search engines that your site provides a quality user experience, potentially boosting your search rankings.

💰

Reduced Bandwidth Costs

For high-traffic websites, bandwidth costs can be substantial. When you compress HTML by 40-60%, you reduce the amount of data transferred with every page load. This translates to lower hosting bills and CDN costs. For a site with 1 million monthly visitors, this could save hundreds of dollars per month.

📱

Enhanced Mobile Experience

Mobile devices often have limited processing power and network connectivity. Minified HTML loads faster on mobile networks (3G/4G), reduces data consumption for users with limited plans, and improves overall mobile user experience. With mobile-first indexing, Google prioritizes mobile performance.

🚀

Better User Experience

Fast-loading pages keep users engaged. Research by Amazon found that every 100ms of latency cost them 1% in sales. When you minify HTML, you contribute to a snappier, more responsive website that keeps visitors engaged and reduces bounce rates. Happy users are more likely to convert and return.

🌍

Reduced Carbon Footprint

Smaller files mean less data transferred across the internet, resulting in lower energy consumption. According to the Green Web Foundation, optimizing web assets is one of the most effective ways to reduce the environmental impact of your website.

💡

Real-World Impact

Major websites like Google, Facebook, and Amazon heavily minify their HTML and other assets. Google reported that reducing page load time by 0.5 seconds resulted in a 20% increase in traffic. HTML minification is a critical optimization technique used by top-performing websites worldwide.

Whether you're building a landing page, blog, e-commerce site, or web application, using an HTML minifier should be a standard part of your deployment process to maximize performance and user satisfaction.

How it works

Our free HTML minifier tool takes your formatted or messy HTML code and transforms it into a compact, optimized version in seconds. How to minify HTML online? Here's how simple it is:

  1. 1

    Paste your HTML

    Or fetch HTML from a URL (if allowed by CORS).

  2. 2

    Choose options

    Remove comments, collapse whitespace, and keep safe spacing.

  3. 3

    Minify and export

    Copy the output or download an .html file.

Why use an HTML Minifier?

  • Reduce page size and bandwidth
  • Improve load-time performance signals
  • Keep pages cleaner for deployment
  • Great for static sites and landing pages
  • Works instantly, no sign-up
💡

Pro tip: Pair this with an HTML Formatter for editing, then minify right before shipping.

Best Practices for HTML Minification

While HTML minification is generally safe and straightforward, following these best practices ensures optimal results without breaking your website:

1

Only Minify for Production

Keep your development and source files formatted and readable with proper indentation and comments. Only minify HTML for production when deploying to production. This maintains code readability for your development team while delivering optimized files to end users. Use this HTML minifier instant tool to quickly optimize files before deployment.

DO: Keep source.html readable → Minify to dist/index.html for deployment
DON'T: Edit minified files directly

2

Always Test After Minification

After minifying, test your website thoroughly. While rare, some edge cases can cause issues: <pre> tags with sensitive whitespace, inline JavaScript that parses HTML, or CSS selectors that depend on whitespace.

Test checklist: Layout rendering • JavaScript functionality • Form submissions • Responsive design • Browser compatibility

3

Use Version Control

Store your original, formatted HTML in version control systems like Git. Never commit minified files to your repository (unless they're in a build/dist directory). This keeps your repository clean and makes code reviews manageable.

Add to .gitignore: dist/*.min.html or build/

4

Automate the Process

For projects with frequent updates, automate HTML minification in your build pipeline. Use build tools like Webpack, Gulp, Vite, or Next.js with minification plugins. This ensures consistency and eliminates manual steps.

Popular tools: html-minifier-terser • HTMLMinifier plugin for Webpack • Built-in Next.js optimization

5

Combine with Other Optimizations

HTML minification is most effective when combined with other performance optimizations. Also minify your CSS and JavaScript, enable gzip/brotli compression on your server, use a CDN, optimize images, and implement caching strategies. Pair this HTML compression tool with our JSON Minifier for complete web asset optimization. After minifying, run the HTML Performance Analyzer to measure render-blocking improvements, and the HTML SEO Analyzer to confirm minification hasn't affected on-page SEO.

Optimization stack: HTML Minification → CSS/JS Minification → Server Compression → CDN → Caching

6

Monitor Performance Metrics

Use tools like Google PageSpeed Insights, WebPageTest, or Lighthouse to measure the impact of minification. Track metrics like First Contentful Paint, Largest Contentful Paint, and Total Blocking Time before and after optimization. This helps you understand how minifying HTML for SEO improves your search rankings.

Key metrics: FCP • LCP • TBT • CLS • TTI • File size reduction

⚠️

Common Mistakes to Avoid

  • Minifying HTML with <pre> or <code> blocks without testing
  • Removing conditional comments needed for IE compatibility (if still supporting IE)
  • Editing minified files instead of keeping a source version
  • Minifying during development (slows debugging)
  • Not testing on different browsers after minification

HTML Minification Methods Comparison

Choose the right HTML minifier approach based on your project needs and workflow:

MethodSpeedFile Size ReductionEase of UseCostBest For
🌐Online Tool (This Page)
⚡⚡⚡
Instant
40-60%
Good
⭐⭐⭐
Very Easy
Free
Quick tests, one-off files, small projects
🔧Build Tool (Webpack/Vite)
⚡⚡
Fast
50-70%
Excellent
⭐⭐
Moderate
Free
Large projects, automated workflows, SPAs
⚙️CLI Tool (Node.js)
⚡⚡⚡
Very Fast
50-65%
Very Good
⭐⭐
Moderate
Free
Scripting, batch processing, CI/CD pipelines
☁️CDN with Auto-Minify
⚡⚡⚡
Instant
50-65%
Very Good
⭐⭐⭐
Very Easy
$$
Paid
High-traffic sites, enterprise, global distribution
🤖Framework Built-in (Next.js)
⚡⚡
Fast
55-75%
Excellent
⭐⭐⭐
Very Easy
Free
React apps, SSR projects, modern frameworks
💡

Recommendation

For quick one-off tasks, use this online HTML minifier. For production projects, integrate minification into your build process using tools like Webpack, Gulp, or your framework's built-in optimizer. For enterprise sites with high traffic, consider a CDN with automatic minification like Cloudflare or Fastly for edge optimization.

Frequently Asked Questions

Is HTML minification safe?

Generally yes. Minification removes whitespace and comments while keeping structure intact. Always test if you rely on whitespace-sensitive layouts.

Do you store my HTML?

No. This tool processes input locally in the browser and does not upload your content. Your code never leaves your device.

Does this remove comments?

Yes by default. Toggle "Remove HTML comments" to keep them.

Will this break inline scripts?

Usually no, but be cautious if your scripts parse HTML strings or depend on exact whitespace. When in doubt, test.

How much file size can I save by minifying HTML?

On average, HTML minification can reduce file size by 40-60%, depending on your code's formatting and comment density. Some files with heavy commenting can see even greater reductions.

Does HTML minification improve SEO?

Yes, indirectly. Minified HTML loads faster, improving Core Web Vitals metrics like First Contentful Paint (FCP) and Largest Contentful Paint (LCP), which are ranking factors for Google. Faster pages provide better user experience.

Can I minify HTML automatically in my build process?

Yes. Most modern build tools (Webpack, Vite, Next.js) have HTML minification plugins. You can also use command-line tools like html-minifier-terser or integrate minification into your CI/CD pipeline.

What's the difference between minification and compression?

Minification removes unnecessary characters (whitespace, comments) from code itself. Compression (like gzip or brotli) is applied by web servers during transmission. Both work together - minify first, then compress for maximum file size reduction.

Can I minify HTML with inline CSS and JavaScript?

Yes, this HTML minifier processes inline CSS and JavaScript within HTML files. However, for best results, consider using dedicated CSS minifiers for external stylesheets and scripts.

How do I minify HTML for WordPress or CMS sites?

For WordPress, use caching plugins like W3 Total Cache or WP Super Cache that include HTML minification. For other CMS platforms, check for built-in optimization settings or use server-level minification via CDN services like Cloudflare.

Can minified HTML be formatted back to readable code?

Yes, you can use our HTML Formatter to beautify minified HTML back to readable format. However, comments removed during minification cannot be restored.

Is it safe to minify HTML with conditional comments?

Conditional comments (IE-specific) are generally preserved during minification, but if you still support Internet Explorer, test thoroughly. Modern browsers ignore conditional comments, so removing them is usually safe for current web standards.

HTML Minification Guides

Step-by-step guides for minifying HTML in specific situations:

All HTML Minify guides (15 total)

Related HTML & Optimization Tools

Explore our complete suite of developer tools to optimize your web projects:

From the FixTools Blog

How to Minify HTML, CSS, and JavaScript Safely

What minification actually removes, edge cases that can break your site, and how compression and minification work together.

Read guide →

Reduces HTML file size significantly

🔒

No file upload, paste and compress

Works on files of any size

Free with no account required

Cost
Free tier
Sign-up
Not required
Processing
Tool-specific
Privacy
Clearly disclosed
IframeResponsiveAttribution included

Add this HTML Minify to your website

Drop the HTML Minify into a blog post, product docs, intranet, or school portal with one iframe. Processing, privacy, and usage limits are the same as on the full tool page.

  • One copy-ready line of HTML
  • Responsive — adapts to any container width
  • No API credentials are placed in the snippet

Embed code

<iframe
  src="https://www.fixtools.io/html/html-minify?embed=1"
  width="100%"
  height="780"
  frameborder="0"
  style="border:0;border-radius:16px;max-width:900px;"
  title="HTML Minify by FixTools"
  loading="lazy"
  allow="clipboard-write"
></iframe>

Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.

Source-Level HTML Compression: What It Does and Why It Helps

When developers talk about compressing an HTML file, they usually mean one of two things: source-level compression, which removes redundant characters from the markup itself, or transfer-level compression, which applies gzip or Brotli to the HTTP response payload. FixTools handles source-level compression. This matters because source compression reduces the raw file size stored on disk and cached on CDN edge nodes, which lowers both storage costs and the volume of data the server must process before each response. For static hosting services that bill by storage and egress, compressing every HTML file at the source level is one of the lowest-effort, highest-return optimisations available, requiring no infrastructure changes whatsoever.

The compression algorithm tokenises the HTML input into a stream of element nodes, text nodes, and comment nodes. Text nodes that contain only whitespace characters between block-level elements are dropped entirely. Text nodes inside inline elements are preserved to avoid collapsing word boundaries. Comment nodes are discarded unless they are conditional comments required for older browser compatibility. The token stream is reassembled as a single compact string. This process is deterministic: identical input always produces identical output, which means you can safely include it in automated build pipelines where reproducibility matters.

After compressing, paste the output directly into your deployment pipeline. For static sites, replace the original file with the compressed version. For server-rendered sites, apply compression as a post-processing step in your build after all content generation is complete. Always retain the uncompressed source file in version control so you can make edits and re-compress rather than trying to edit the compressed output.

A practical concern for any HTML compression workflow is whether to compress on the server before the response is written or to deliver pre-compressed static files. Server-side compression at request time, often implemented as middleware in Express, Fastify, or a similar framework, gives you a single source of truth and removes the build step entirely, but it adds per-request CPU work and introduces a latency cost that scales with traffic. Pre-compressed delivery means the compression runs once during the build and every request reads the already-compressed file from disk, which is dramatically more efficient at high request volumes and is the approach used by every major static hosting platform. FixTools is well suited to the pre-compressed model: you compress the file once locally or in CI, commit the compressed output or generate it during deployment, and the runtime cost of compression drops to zero because no compression work happens on the server at all.

How to use this tool

💡

Paste your HTML and click Minify to compress. The output is the smallest valid representation of your HTML document.

How It Works

Step-by-step guide to compress html file online:

  1. 1

    Paste your HTML

    Paste the full HTML file contents into the input panel of the HTML Minifier. You can paste a complete HTML document or a partial fragment. The tool processes both without any configuration needed.

  2. 2

    Compress

    Click the Minify button to run the compression. The tool removes all whitespace-only text nodes between block elements, strips HTML comment nodes, and applies tag-level simplifications where the HTML5 specification permits optional omission.

  3. 3

    Note the size reduction

    Review the before and after sizes displayed in the interface. A reduction of 10 to 30 percent is typical for well-formatted HTML. If the reduction is below 5 percent, your source HTML is already compact. If it exceeds 30 percent, comment-heavy sections or deep indentation are the main contributors.

  4. 4

    Copy the compressed HTML

    Copy the compressed HTML using the copy button and integrate it into your production build, static file upload, or email template system. Store the original uncompressed source separately in version control.

Real-world examples

Common situations where this approach makes a real difference:

Compressing HTML before uploading to a static hosting service

Static hosting services such as Netlify, Vercel, and Amazon S3 serve files exactly as uploaded without applying source-level modifications. Compressing your HTML before upload ensures every visitor receives the smallest possible file. On a site with 50 HTML pages averaging 60KB each, compressing to 46KB saves 700KB of stored data and that same saving is delivered to every visitor on every page view, compounding into substantial bandwidth reduction at scale.

Reducing HTML email template size

Email service providers impose strict size limits on HTML emails: Gmail clips messages exceeding approximately 102KB of message content. An email template at 110KB risks clipping, which hides unsubscribe links and call-to-action buttons below the clipped boundary. Compressing the HTML template to under 90KB eliminates that risk, ensures the full email renders for every recipient, and improves deliverability metrics by reducing the chance of the message being flagged for excessive size by spam filters.

When to use this guide

Use this when you need to reduce the size of an HTML file before including it in a production build, email template, or any context where file size is a constraint.

Pro tips

Get better results with these expert suggestions:

1

Target comment-heavy files first

HTML files containing large comment blocks, licence headers, or sections of commented-out code see the largest compression ratios because comments are dropped entirely rather than just shortened. Identify these files first in your project by looking for HTML files with many developer notes or scaffolded placeholder sections. Compressing these delivers the largest quick wins before you process leaner files.

2

Use the formatter to verify

After compressing, paste the output into the HTML Formatter to expand it back to readable form and visually confirm the document structure is intact. Check that heading hierarchy, list nesting, and table structure look correct after expansion. This verification step takes under 10 seconds and catches any rare edge-case compression issues before you deploy to production where they would be harder to diagnose.

3

Compress partials, not just full pages

If your site assembles pages from partial template files such as header.html, footer.html, and nav.html, compress the partials individually. Whitespace that exists in a single partial multiplies across every page that includes it, so compressing the partial eliminates redundant whitespace from every assembled page simultaneously without requiring you to compress each final page separately.

4

Combine with CDN edge caching

A compressed HTML file served from a CDN edge node located close to the end user produces the best possible combination of small payload and low latency. The compressed source reduces the cache storage size on each CDN edge node, which can lower CDN storage costs for large deployments with thousands of unique HTML pages and can improve cache hit rates because compressed files consume less edge cache space.

5

Check compression ratio before deploying

After compressing, compare the original and compressed sizes. A ratio of 10–30% is typical. If the ratio is lower, your original HTML may already be fairly lean.

6

Compress all static HTML files in your project

For maximum effect, compress every static HTML file in your project, not just the homepage. Every page load benefits from reduced HTML size.

7

Script and style content is not altered

The HTML compressor removes whitespace between HTML elements. Inline scripts and styles are not modified, compress those separately with the CSS and JS minifiers.

FAQ

Frequently asked questions

No. HTML source compression, also called minification, removes whitespace and comments from the HTML content itself, reducing the raw file size stored on disk. Gzip is a transfer-level encoding applied by the web server to the bytes it sends over the network. The two operate at different layers and complement each other. Source-compressing your HTML first and then enabling gzip on the server produces better gzip ratios than gzip alone, because the minified HTML contains less repetitive whitespace for gzip to work with.
Typical HTML files see a 10 to 30 percent reduction from minification. Pages with heavy inline comments, licence text in the header, or verbose indentation across deeply nested layouts can see 35 to 40 percent or more. The gains compound significantly when combined with server-level gzip or Brotli compression: a page reduced from 80KB to 58KB by minification and then compressed to 14KB by Brotli delivers 83 percent fewer bytes than the original uncompressed, unminified file.
Positively, over time. Compressed HTML loads faster, which improves Core Web Vitals scores, particularly Time to First Byte and Largest Contentful Paint. Google uses Core Web Vitals as a ranking signal in its search algorithm. Consistently faster pages accumulate better field data in the Chrome User Experience Report, which feeds into PageSpeed Insights scores and influences organic ranking. The effect is modest on its own but compounds with other performance improvements into a measurable ranking advantage.
Yes. Inline SVG is valid HTML content and is processed correctly by the compressor. Whitespace between SVG elements is removed in the same way as whitespace between HTML elements, producing a more compact inline SVG block. The rendered graphic is unaffected because SVG rendering is based on element attributes and path data, not on whitespace between elements. Complex SVG with many path elements can contribute several kilobytes of compressible whitespace, so the saving from SVG sections can be meaningful.
Standard HTML comments opened with are stripped by the compressor because they have no effect on rendering. Internet Explorer conditional comments opened with a specific syntax may be preserved by conservative minifiers for compatibility with older versions of Internet Explorer. If you no longer need to support Internet Explorer at all, it is safe to let the compressor remove conditional comments. Check your browser support matrix before deciding whether conditional comments should be preserved.
Content inside pre, code, and textarea elements depends on whitespace for correct display and must be preserved exactly. FixTools handles these elements conservatively, leaving their content untouched. You should also be cautious with HTML that contains server-side include directives, custom template tags, or processing instructions that might be disrupted by whitespace removal before the template engine has processed them. Always compress the final rendered HTML output, not the template source files themselves.
For automated compression in a Node.js build environment, use html-minifier-terser as a dependency in your Webpack, Vite, or Gulp pipeline. HtmlWebpackPlugin for Webpack includes built-in minification options configurable in the plugin settings. For static site generators like Hugo or Eleventy, post-processing plugins handle HTML minification after the site is built. FixTools is the right tool for manual compression of individual files, quick spot-checks before deployment, and any workflow where installing build tools is not practical.
Minified HTML is harder to read in the DevTools Elements panel because all whitespace is removed and the markup appears on fewer lines. However, the DevTools parser re-formats the DOM view independently of the raw source, so you can still inspect elements, view computed styles, and examine the accessibility tree normally. The Sources panel will show the minified HTML if you view the raw document. For debugging sessions, use the formatter to expand the HTML into a readable form before inspecting.
JavaScript-bound markup is the typical victim when a minifier is too aggressive. Three common patterns break: text-node lookups that depend on a specific child index in the DOM, since removed whitespace text nodes shift the index of subsequent siblings; selectors that match adjacent siblings via the plus combinator where the whitespace previously created an intervening text node that the framework was navigating around; and code that walks childNodes expecting a known length. The fix in modern code is to use element.children rather than childNodes, query selectors that target elements directly rather than positional indices, and avoid relying on the presence of whitespace text nodes for any logic. Re-compress the file after refactoring those selectors.
For Next.js, HTML compression of the final rendered output happens automatically in production builds. The framework runs through Terser for JavaScript and an internal HTML pipeline that strips whitespace from server-rendered and statically generated pages. Manual compression on the source JSX is unnecessary and would not help because JSX is compiled to JavaScript, not delivered as raw HTML. The role for FixTools in a React project is compressing static HTML assets that live outside the framework: standalone landing pages in the public directory, email templates rendered separately, and any prerendered HTML you serve from a CDN that bypasses the React runtime entirely. For those files, manual compression produces measurable savings on every request.
Content management systems frequently impose upload size limits on individual HTML files, with WordPress capped by default at the PHP upload_max_filesize directive often set to one or two megabytes by the host, Shopify limiting theme file uploads to around one megabyte per file, Squarespace and Wix imposing similar boundaries on raw HTML imports, and email service providers like Mailchimp restricting template sizes to roughly 1MB or 102KB depending on the workflow. Compressing the HTML before upload is the single fastest way to fit under those limits without restructuring the content. A 1.4MB hand-authored landing page with extensive inline SVG, generous indentation, and developer comments typically compresses to between 950KB and 1.1MB, which clears most platform ceilings comfortably. For files that are still too large after compression, the next step is to externalise large inline assets like SVG icons into a sprite sheet referenced by id, move inline CSS into a separate stylesheet linked from the head, and break long single-page templates into includes processed by the CMS at render time. Each of those changes reduces the raw HTML size further while preserving the visual result, and combined with compression they cover the full range of file size constraints you will encounter in practice.
File-based minification operates on HTML files on disk, reading the input file, processing the content, and writing a new output file. This is the standard mode for build pipelines and command-line tools, suitable for processing many files in batch as part of a deployment workflow. String-based minification operates on HTML content already loaded in memory as a string, which is the mode FixTools uses when you paste HTML into the input panel. The output is also a string, available immediately for copying or further processing without ever touching the file system. String-based mode is the right fit for browser-based tools, for ad-hoc minification of HTML pulled from a clipboard, and for any workflow where the HTML originates from a source other than a file on disk such as a database column, an API response, or a generated template string. Both modes apply identical minification logic and produce identical output for the same input. The choice between them is purely about how the HTML enters and leaves the tool, not about what the tool does to the content itself.

Related guides

More use-case guides for the same tool:

Ready to get started?

Open HTML Minify to review its free limits and processing method.

Open HTML Minify →

Free tier · No account needed · Transparent limits