We've been hosted on Digital Ocean since 2013 and highly recommend it for your hosting too. Try it now!

JavaScript Minifier

Online JavaScript Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.

Written and hosted by Andrew Chilton (@andychilton) since 2012.


To minify/compress your JS perform a POST request to https://javascript-minifier.com/raw with the input parameter set to the JavaScript you want to minify.


wget --post-data='input=console.log( 1 );' --output-document=- https://javascript-minifier.com/raw
wget --post-data="input=`cat main.js`" --output-document=main.min.js https://javascript-minifier.com/raw


curl -X POST -s --data-urlencode 'input=console.log( 1 );' https://javascript-minifier.com/raw
curl -X POST -s --data-urlencode 'input@main.js' https://javascript-minifier.com/raw > main.min.js


POST https://javascript-minifier.com/raw?input=...

To see implementations in other languages see the other Language Examples pages below.

Many people have sent language examples over the years, but we want more! We'd love to add more examples in your favourite programming language, so please send them our way. Email andychilton at that gmail place in the sky, tweet me @andychilton, or open an issue or PR on webdev.sh/javascript-minifier.com.

Click on the language of your choice to see an example: