HTML / CSS / JS Minifier
Developer
Paste source code, pick HTML / CSS / JS, and the tool removes redundant whitespace and (optionally) comments, returning a single-line minified version with the byte size before and after plus the percentage saved. Pure regex-based — fast, fully offline, no library required. Best for small inline snippets and final-mile size trims; for build pipelines, use a dedicated minifier like terser or esbuild.
<!doctype html><html lang="en"><head><title>Sample Page</title></head><body><h1>Hello, world!</h1><p> This is a paragraph with multiple lines. </p></body></html>
How to use
- Paste your source code.
- Pick the language (HTML / CSS / JS).
- Toggle whether to strip comments.
- Copy the minified output.
Frequently asked questions
- Is this safe for production?
- For small CSS or HTML, yes — the rules are conservative. For JavaScript, prefer a tool like terser or esbuild in your build, since this tool doesn't rename variables, fold constants, or do dead-code elimination.
- Why isn't my JS more compressed?
- True JS compression needs an AST-based tool. This minifier removes whitespace and comments only — that's already a big win for hand-written snippets but won't match terser's output.
- Will it break HTML inside <pre> or <textarea>?
- It can — whitespace there is significant. Avoid running the minifier on HTML containing those elements, or replace their contents with a placeholder first.
- Are CSS comments important?
- Sometimes — license headers in /*! comments by convention are kept by professional minifiers. This tool removes all comments if 'strip comments' is on; for license-preserving output, set it off.
Related tools
JWT Decoder
Decode a JSON Web Token to inspect its header, claims, and expiration.
UUID Generator
Generate random version-4 UUIDs in bulk, with copy.
Hash Generator (SHA)
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, instantly.
JSON Formatter & Validator
Format, beautify, minify, and validate JSON right in your browser.