JS Minifier
Minify JavaScript using Terser — removes whitespace, shortens variable names, and removes dead code. Paste your JS and get a production-ready compressed bundle.
How to use the js minifier
Paste JavaScript into the input box and press Minify. Comments and whitespace are stripped. This is a safe minifier — it does not mangle identifiers or perform tree-shaking.
Formula & explanation
Removes // and /* */ comments, collapses whitespace, removes spaces around operators and punctuation.
Examples
Useful for inline scripts in HTML where every byte matters.
Frequently asked questions
- Is this safe for all JS?
- Mostly — but it can break code that relies on whitespace around regex literals or template strings. Check output before shipping.
Related developer tools tools
- CSS MinifierMinify CSS for production by stripping whitespace, comments, and redundant rules. Paste your stylesheet and get the compressed output ready to ship or inline.
- XML FormatterFormat, indent, and validate XML documents. Detects malformed tags, unclosed elements, and bad attributes with clear line-level error messages. Great for config and API work.
- Regex TesterTest JavaScript regular expressions live with instant match highlighting. Supports all JS regex flags (g, i, m, s, u) and shows match groups, indices, and global matches.
- SQL FormatterPretty-print and format SQL for any major dialect — MySQL, PostgreSQL, SQLite, T-SQL, and more. Normalizes indentation, keywords, and spacing for readable, consistent queries.
- Curl to Code ConverterPaste a curl command, get equivalent code in JavaScript (fetch/axios), Python (requests), or Go (net/http). Handles headers, JSON bodies, basic auth, and form data.
- Base64 Encoder/DecoderEncode text or binary data to Base64 and decode Base64 strings back to text. Supports standard and URL-safe Base64. Useful for data URIs, API tokens, and email attachments.