This free HTML, CSS, and JavaScript minifier provides a quick way to remove selected comments and whitespace from pasted code, or make compact code easier to read with the Beautify option. Choose a language, choose Minify or Beautify, paste your code, and run the operation. Processing happens in your browser.
Supported languages and actions
- HTML: remove HTML comments and collapse whitespace between markup elements.
- CSS: remove block comments and reduce whitespace around common CSS punctuation.
- JavaScript: apply a lightweight text-based comment and whitespace reduction.
- Beautify: add line breaks and indentation to make simple markup or code easier to inspect.
How to minify or beautify code
- Choose HTML, CSS, or JavaScript.
- Select Minify to reduce selected comments and whitespace, or Beautify to add basic formatting.
- Paste the source into the input field.
- Select the action button to process the text.
- Review the output carefully, then use Copy if you want to reuse it.
Important: this is a lightweight text transformer
This tool does not use a full HTML, CSS, or JavaScript parser. Its transformations are based on simple text patterns, not compiler-level analysis. In particular, the JavaScript operation can change code that contains comment-like sequences inside strings or template literals, regular-expression literals, or syntax where line breaks affect automatic semicolon insertion. The HTML and CSS operations are also not a substitute for a standards-aware minifier and can change formatting-sensitive content.
Do not use this tool as the final production build step for critical code. Keep your original source, compare the result, run your normal test suite, and use a parser-based build tool such as your project bundler or a maintained minifier for production assets.
Minification vs. compression
Minification removes selected characters from source code while keeping it intended to remain readable by a browser. It is not the same as gzip or Brotli compression, which compress data for transfer and are usually applied by a web server or CDN. This page does not report a reliable bundle-size or transfer-size saving, generate source maps, rename variables, perform tree-shaking, or bundle dependencies.
When this tool is useful
Use it for quick experiments, small snippets, learning how whitespace affects source text, or making a simple example easier to paste into a discussion. For a more involved workflow, test your code in the HTML, CSS & JavaScript Editor, compare revisions with Text Diff, or validate structured data with the JSON Formatter.
Privacy and limitations
The text transformation runs locally in the browser; your pasted code is not uploaded for processing. The tool does not accept file uploads, preserve source maps, understand every modern JavaScript syntax form, or guarantee semantic equivalence. Always test output in the environment where it will run.
