🌐 English

HTML, CSS & JavaScript Minifier

Minify HTML, CSS and JavaScript online to reduce file size and speed up websites. JavaScript is compressed with Terser. Free, private and runs in your browser.

  1. Upload
  2. Options
  3. Download

How to: HTML, CSS & JS Minifier

  1. Paste HTML, CSS or JavaScript.
  2. The language is detected automatically, or choose it.
  3. Copy the minified code or download the file.

Every byte a visitor downloads slows your site a little, especially on mobile networks. Minifying removes comments, whitespace and unnecessary characters from HTML, CSS and JavaScript, often cutting file size by 20–60%. This tool uses Terser, the same JavaScript minifier used by popular build tools, plus fast CSS and HTML minifiers, all running in your browser.

Common uses

Tips for best results

What each minifier does

The CSS minifier removes comments and whitespace, drops the last semicolon in each block and shortens colours such as #ffffff to #fff. The HTML minifier collapses whitespace between tags and removes comments, while leaving pre, textarea, script and style blocks untouched unless you choose to minify inline code. JavaScript is parsed into a syntax tree by Terser, compressed and printed without comments.

Minification and Core Web Vitals

Smaller files load and parse faster, which helps Largest Contentful Paint and Interaction to Next Paint, two of Google's Core Web Vitals. For large sites, a build tool such as Vite or esbuild is the best long-term option; for small sites, landing pages and quick fixes, this minifier gets you most of the benefit in seconds.

Why use FreePDF for HTML, CSS & JS Minifier?

FreePDFTypical upload-based sites
What you type is sent to a serverNo – stays in your browserOften
Sign-up requiredNeverOften for bigger jobs
Hourly / daily task limitsNoneCommon on free plans
Works offline after loadingYes, for most toolsNo

Frequently asked questions

Will minifying break my code

Minification removes whitespace and comments and shortens local variable names without changing behaviour. Test the result, especially for HTML with whitespace-sensitive inline elements.

Which JavaScript features are supported

Modern ES2023 syntax, including modules, classes, async/await and optional chaining, via the Terser engine.

Is HTML, CSS & JS Minifier really free?

Yes. Every tool on FreePDF is 100% free with no file limits, no sign-up and no watermarks. The site is supported by unobtrusive ads.

Are my files uploaded to a server?

No. FreePDF processes your files directly in your browser using JavaScript. Your documents never leave your device, so they stay completely private.

Does it work on mobile?

Yes. FreePDF works in any modern browser on Android, iPhone, iPad, Windows, Mac and Linux.

Other tools

JSON Formatter & ValidatorBase64 Encode & DecodeURL Encode & DecodeHash GeneratorUUID GeneratorRegex TesterColor ConverterMerge PDFSplit PDFRotate PDFAdd Page NumbersJPG to PDFPDF to JPGCompress PDF