Minify JS, CSS & HTML Online

Minify JavaScript (Terser), CSS (CSSO), HTML and JSON, with the byte and gzip size before and after; the language is detected automatically.

Free tool: 20 requests per minute.

Result

Press “Run” to see the result.

The minifier shrinks front-end code for production. JavaScript goes through Terser (two compression passes, local names mangled, module=true for ES modules), CSS through CSSO (merges rules, shortens colours and values, restructure=false for a safer pass), JSON is re-serialised without whitespace, and HTML loses comments and whitespace between block tags while its inline <script> and <style> blocks are minified too.

Leave type empty to detect the language from the code, or set js, css, html or json. License comments (/*! … */, @license, @preserve) are kept. In HTML, <pre> and <textarea> content is left untouched, one space is kept between inline tags, and minify_js=false / minify_css=false leave embedded code as it is.

The answer gives the minified code and size: input and output bytes, the percentage saved and gzip sizes, the number that matters for download time. Syntax errors return parse_error with the line and column.

Use this in your code

curl -X POST "https://apibox.io.vn/v1/minify" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"function tinhTong(soThuNhat, soThuHai) {\n  // cộng hai số\n  const tong = soThuNhat + soThuHai;\n  return tong;\n}\nconsole.log(tinhTong(1, 2));"}'

API documentation → Get a free API key

FAQ

Is my code changed in behaviour?

Terser and CSSO apply safe transformations. If a script relies on function names, send mangle=false.

Does it support TypeScript or SCSS?

No: compile to JavaScript or CSS first, then minify.

What is the size limit?

2,000,000 characters of code per call.