Code Minifier
Minify JS, TS, JSX, TSX, CSS, HTML, JSON, YAML, XML, SVG, GraphQL, and SQL
Shrink code for production delivery
Removes comments and extra whitespace, and compresses where a real engine exists. This does not rewrite your algorithms — it makes the file smaller to download. Everything runs locally in your browser.
Compress with Terser — remove comments, whitespace, and shorten names.
About this code minifier
Minify source code from a language dropdown to reduce byte size. Upload files up to 5 MB, run Minify, and see byte savings. Processing is local in the browser with copy and download support for the minified output.
How to use
- Pick the language that matches your snippet from the dropdown.
- Paste code or upload a file (5 MB max).
- Click Minify and review the output plus reported byte savings.
- Copy or download the minified result if it looks correct.
What minification changes
Minifiers remove whitespace, shorten syntax where safe, and may drop optional tokens depending on the language engine bundled for each option. Behavior varies by language—always run tests or linters after minifying production code.
Common uses
- Shrink snippets before embedding in HTML or email templates.
- Compare size wins between language formatters.
- Quickly produce a one-off compact version for demos.
Tips
- Keep an unminified source of truth in version control.
- If minify errors, the language choice may not match the syntax you pasted.
- Very large files should stay under 5 MB to avoid tab memory pressure.
Privacy
Code you paste or upload is minified locally. It is not transmitted to ToolsArk servers for processing.
Limitations
- Minifier quality depends on the selected language engine—not every edge case is safe for all runtimes.
- 5 MB upload cap; no project-wide build or tree-shaking.
- No source maps are generated here.
Frequently asked questions
Common questions about the Code Minifier.
What does the Code Minifier do?
It shrinks code for production delivery by removing comments and extra whitespace and running real compressors where available. It does not rewrite your algorithms — it makes files smaller to download. Everything runs in your browser.
What languages does the Code Minifier support?
JavaScript, TypeScript, JSX, TSX, CSS, HTML, JSON, YAML, XML, SVG, GraphQL, and SQL. Choose a language, paste or upload your file, then minify.
What happens when I minify TypeScript, JSX, or TSX?
Types and JSX are compiled away into modern JavaScript, then minified with Terser. The download is minified.js. Keep your original source for editing — use the output for production.
Is minification done with real minifiers or just whitespace removal?
Real engines where it matters: Terser for JavaScript, Sucrase + Terser for TypeScript/JSX/TSX, CSSO for CSS, JSON/YAML parse-and-dump, GraphQL ignored-character stripping, SQL comment/whitespace compaction, and browser DOM cleanup for HTML/XML/SVG.
Does my code leave my device?
No. The Code Minifier runs fully in your browser. Nothing is uploaded to ToolsArk servers for minification.
Why did minification fail?
Usually the input has a syntax error the minifier cannot parse. Fix the reported error, confirm the correct language is selected, and try again.
Tags
Continue with these utilities
People frequently use these utilities together.