Fully optimised production performance requires minifying all three static asset types that make up a web page.
Loading HTML Minify…
Separate tools for HTML, CSS, and JS
All free and browser-based
Complete minification workflow
No installation or build tools required
Drop the HTML Minify into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
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.
A web page is built from three file types, each contributing independently to the total byte payload the browser must download before the page is fully interactive. HTML defines the document structure and is downloaded first, blocking rendering until enough of it is parsed to build the initial DOM. CSS is render-blocking: the browser will not paint the page until all stylesheet content is downloaded and parsed into the CSSOM. JavaScript that is not deferred or async-loaded blocks the HTML parser, preventing DOM construction and rendering until each script is downloaded and executed. Unminified, a typical marketing page might carry 60KB of HTML, 80KB of CSS, and 150KB of JavaScript. Minifying all three reduces this to approximately 48KB HTML, 60KB CSS, and 120KB JavaScript. The combined 62KB saving, before server compression, represents a 21 percent reduction in total payload. Under Brotli or gzip compression, the savings compound further. The browser starts rendering sooner, the LCP element loads faster, and interactive time is reached earlier.
The correct order for minifying multiple file types matters when those files reference each other. CSS and JavaScript should be minified before HTML for two reasons. First, inline script and style blocks in HTML that you want to compact must be replaced with their minified versions before the HTML minification pass, otherwise the HTML minifier processes formatted CSS and JavaScript inside those blocks without being able to minify their content. Second, if you use content-hash-based filenames for external CSS and JS files, those hashes are computed from the file content after minification. The final HTML file references these hashed filenames in its link and script tags, so the HTML must be assembled and minified after the CSS and JS filenames are known. Following the order CSS, then JavaScript, then HTML ensures these dependencies are resolved correctly.
For ongoing production projects, automating the entire three-file minification sequence in a build pipeline is more practical than manual minification on every deployment. Webpack handles all three with HtmlWebpackPlugin for HTML, css-minimizer-webpack-plugin for CSS, and the built-in Terser integration for JavaScript. Vite applies CSS and JavaScript minification automatically in production builds and optionally applies HTML minification through its plugin ecosystem. For projects without a build tool, and for one-off minification tasks or spot-checks, use the FixTools CSS Minifier, JavaScript Minifier, and HTML Minifier in sequence to achieve the same quality output manually.
Template engines complicate the joint minification story in a specific way that is worth understanding before configuring a pipeline. When Jinja2, Liquid, Twig, or Handlebars renders a page, it interpolates variables into a base template and produces a final HTML string that contains the rendered values along with any whitespace from the template structure. CSS classes and JavaScript hooks referenced inside template tags are stable strings, but the surrounding markup carries the indentation of the template file itself. Running minification on the template source before rendering can corrupt template syntax when whitespace surrounds significant tags. Running minification on the rendered output after every render is functionally safe but expensive at scale. The middle path is to render once during the build, minify the rendered HTML alongside the bundled CSS and JavaScript, and ship the trio together. For sites that personalise per request, minify the static template scaffolding at build time and inject only the personalised tokens at request time, which preserves most of the saving without per-request minification cost.
Start with HTML Minify, then CSS Minifier, then JS Minifier. Together they cover every static asset type for maximum production performance.
Step-by-step guide to minify html, javascript, and css together:
Minify CSS first
Open the FixTools CSS Minifier and paste each of your CSS files in turn, clicking Minify for each. Copy the minified output and save it as your production CSS. Record the original and minified sizes. If you have inline styles in your HTML, collect the minified versions of these CSS blocks too for use in the next step.
Minify JavaScript
Open the FixTools JavaScript Minifier or an equivalent tool such as Terser Online and paste each of your JavaScript files. Copy the minified output as your production JavaScript. If you have inline script blocks in your HTML, collect the minified versions for those too.
Minify HTML
Open the FixTools HTML Minifier, paste your HTML, and if it contains inline CSS or JavaScript blocks, replace them with the minified versions you produced in the previous two steps before clicking Minify. This ensures that inline blocks are also minimised in the final output.
Deploy all minified files
Deploy the minified HTML, CSS, and JavaScript files together as your production build. Confirm that CSS and JavaScript filenames referenced in the HTML match the filenames of the minified CSS and JavaScript files you are deploying. Run a final PageSpeed Insights audit to confirm the combined improvement across all three file types.
Common situations where this approach makes a real difference:
Full static site optimisation before launch
Before launching a static marketing site with 12 HTML pages, 3 CSS files, and 5 JavaScript files, the developer manually minifies all assets using the FixTools suite. The CSS files reduce from a combined 78KB to 61KB. The JavaScript files reduce from 145KB to 112KB. The HTML pages average 14 percent reduction per file. The total asset size before server compression drops from 279KB to 217KB, a 62KB saving that translates to a 200ms faster load time on a standard broadband connection and over 400ms on a throttled 4G mobile connection.
Performance sprint to improve Core Web Vitals
A product team runs a focused two-day performance sprint targeting LCP improvement on their top three landing pages. They systematically minify all three asset types: HTML saves an average of 14KB per page, CSS saves 22KB across shared stylesheets, and JavaScript saves 45KB from the main bundle after switching to a newer Terser configuration. The combined 81KB reduction in total payload improves LCP from an average of 3.8 seconds to 2.9 seconds across the three pages, moving all three from "Needs Improvement" to "Good" in their Core Web Vitals assessment.
Use this as a complete performance optimisation workflow guide for preparing all production static files, HTML, CSS, and JS, before deployment.
Get better results with these expert suggestions:
Calculate total savings as a percentage of page weight
After minifying HTML, CSS, and JavaScript, add up the original sizes of all three file types and the minified sizes, then calculate the percentage reduction as a single figure. For example, if the combined original size is 290KB and the combined minified size is 222KB, the total saving is 23 percent. This single-number metric is clear, meaningful, and directly communicable to stakeholders who want to understand the impact of the optimisation sprint without reviewing each file type separately.
Check for duplicate code across files
While reviewing files for minification, look for utility functions that appear in multiple JavaScript files, or CSS utility classes and reset rules that are duplicated across multiple stylesheets. Minification reduces the byte cost of duplicate code proportionally but does not eliminate the duplication itself. Identifying and removing duplicate code before minification produces larger and more permanent savings than minification of duplicated content, and reduces the complexity of the codebase as an additional benefit.
Use source maps for production debugging
When deploying minified CSS and JavaScript for production, generate source maps alongside the minified files. Source maps allow browser DevTools to display the original formatted, named source code when you inspect styles or debug JavaScript in a production session. Without source maps, minified variable names and collapsed CSS rules make production debugging extremely difficult. HTML source maps are less commonly used but are available through some build tools. The source map files are large and should not be served to regular users but should be available to your internal DevTools.
Set up a size budget in your CI/CD pipeline
Define maximum acceptable file sizes for your HTML, CSS, and JavaScript bundles and enforce these limits as a failing check in your CI/CD pipeline using a tool like bundlesize or the built-in budget features in Angular CLI and Next.js. When a build exceeds the budget for any file type, the pipeline fails and alerts the developer who introduced the change. This prevents the gradual size creep that can quietly undo months of optimisation work as new dependencies, components, and features are added to the project over time.
Minify in this order: CSS, JS, HTML
Minify CSS and JS first (they may be referenced in HTML). Then minify the HTML. This order ensures inline scripts and styles are also minified if present.
Track total size reduction across all file types
After minifying HTML, CSS, and JS, compare the total before and after sizes across all files. The combined reduction gives a realistic picture of performance improvement.
Automate with a build tool for ongoing projects
For projects with regular deployments, automate HTML, CSS, and JS minification in a build pipeline (Webpack, Vite, Parcel). Use FixTools for one-off tasks or during initial setup.
More use-case guides for the same tool:
Other tools you might find useful:
Open the full HTML Minify — free, no account needed, works on any device.
Open HTML Minify →Free · No account needed · Works on any device