Developer Tools

HTML / CSS / JavaScript Minifier

Minify HTML, CSS or JavaScript locally using self-hosted parsers. Review byte totals, cancel pending processing and download the result without running pasted code.

Your content stays on your device Free, with no account
Smaller source, with parser-based processing Local worker · 5-second limit
Up to 200,000 UTF-16 source units. Pasted line endings normalize to LF in browser textareas.

HTML removes ordinary comments; inline JavaScript/CSS, attribute quotes and text whitespace are retained by default. Whitespace collapsing cannot account for every CSS layout.

YOUR OUTPUT

Ready. Select the matching language before minifying.

Parsers do not run your code or resolve external assets. Minification can change behavior in edge cases; test the downloaded result. Special /*! notices are kept; other license forms vary by language. Byte totals are uncompressed, not gzip/Brotli savings.

A FEW SIMPLE STEPS

How to use HTML / CSS / JavaScript Minifier

  1. Select HTML, CSS or JavaScript and paste matching source, or load its example.
  2. For HTML, optionally enable text-whitespace collapsing. For JavaScript, choose module mode when appropriate.
  3. Select Minify source. Processing runs locally in a worker; Cancel or edit a field to stop it.
  4. Review the output and uncompressed UTF-8 byte totals, then copy or download HTML/CSS/JS. Test the result in its intended application.
PRIVATE BY DESIGN

Why use this tool?

Source is processed on your device by self-hosted parsers with no uploads, accounts or saved input history. The output is plain text, never rendered or executed. A disposable worker supports cancellation, a time limit and discarding old results after edits.

Tool inputs stay in your browser. Only your theme preference is saved on this device.

A few things worth knowing

Which minifiers and defaults are used?

HTML uses html-minifier-terser 7.2.0, CSS uses CSSO 5.0.5, and JavaScript uses Terser 5.51.2. Browser bundles are self-hosted with verified npm tarball integrity and retained license notices. JavaScript compression and name mangling are disabled. CSS structural rule restructuring is disabled, though syntax and value optimizations still occur. Only the selected parser is loaded in the worker.

What happens to HTML whitespace and inline code?

Ordinary HTML comments are removed. Text-whitespace collapsing starts off; enable it only when appropriate for your page. The parser cannot infer every CSS white-space or layout rule. Inline scripts, event handlers, CSS and URLs are not minified or fetched in HTML mode. Attribute quotes, optional tags and redundant attributes are not intentionally removed. This is not a template-language processor or HTML validator.

Are all comments and legal notices preserved?

Special /*! comments are retained. JavaScript also uses Terser’s special license/preserve comment handling, while HTML retains recognized license/preserve/copyright notices and special directive comments. CSS retains exclamation comments; other comment styles can be removed. Do not assume every legal or tooling directive comment survives. Review notices and build-system annotations in the output.

Does it execute code, fetch assets or produce source maps?

No pasted code is executed or rendered, and this workflow does not resolve URLs, import stylesheets, download scripts or generate source maps. Results stay in readonly textareas. The HTML bundle includes upstream browser shims, but its inline minification and URL-processing paths are disabled. The site’s content security policy also blocks network connections.

Which languages and syntax are supported?

Use plain HTML, CSS or JavaScript supported by the bundled parser versions. Sass, Less, JSX, TypeScript and template languages are not supported. JavaScript module mode is available. Parser acceptance is not full standards validation or proof of runtime equivalence. New syntax and browser-specific constructs may need your normal build tools.

What are the limits and byte totals?

Input accepts 200,000 UTF-16 source units and output is limited to 500,000. A five-second deadline includes library loading and parsing; cancel, edits or page exit terminate work. Errors and timeouts expose no partial output. Unpaired surrogates are rejected to avoid UTF-8 export substitution. Totals measure uncompressed UTF-8 bytes, not gzip/Brotli savings; output can occasionally grow. Clear keeps settings and Example resets language-specific checkboxes.