This guide explains how to use JavaScript Minifier, step by step, with screenshots of the real tool. It is written for site owners who want faster pages and better Core Web Vitals. Minify JavaScript using Terser, the same engine used by modern build tools. Remove whitespace, comments and shorten names safely.
Quick answer: To use the JavaScript Minifier, open the free tool, paste the JavaScript, tick the shorten variable names and tick the remove console.log, then copy the converted output. Everything runs in your browser, so there is no sign up and nothing you type is stored on a server.
On this page

What is the JavaScript Minifier?
Compress and mangle JS code online, remove comments and whitespace, and see bytes saved.
JavaScript is often the biggest cause of slow interaction (INP). Minifying reduces download size; also remove scripts you do not need and load the rest with defer.
How to use JavaScript Minifier step by step
-
Step 1: Open the JavaScript Minifier
Go to the JavaScript Minifier on hasnainsanmal.com. It loads with example values already filled in, so you can see how it works straight away. It works the same way on a phone, tablet or computer.
-
Step 2: Paste JavaScript
Paste or type your text into JavaScript.
-
Step 3: Tick Shorten variable names
Tick Shorten variable names if you want this option, or leave it empty to turn it off.
-
Step 4: Tick Remove console.log
Tick Remove console.log if you want this option, or leave it empty to turn it off.
-
Step 5: Read the results
The output appears inside the tool card. Change any input to compare different scenarios.

Screenshot of the JavaScript Minifier results. -
Step 6: Copy or download the output
Use Copy to take the result into your document, CMS, spreadsheet or report.
What does each field in the JavaScript Minifier mean?
| Field | What to enter | Example |
|---|---|---|
| JavaScript | Text, one item per line where asked | Your own value |
| Shorten variable names | Tick to turn on | on |
| Remove console.log | Tick to turn on | on |
How do you get the best results from the JavaScript Minifier?
- Resize images to the width they are displayed at.
- Test the page again with PageSpeed Insights after changes.
For background, read the Google guide to Core Web Vitals. If you are working on a related task, our guide on how to use the CSS Minifier walks through it the same way. You can also browse all free Image and Page Speed Tools.
What mistakes should you avoid with the JavaScript Minifier?
- Compressing images so hard that they look blurry.
- Uploading huge images and letting the browser shrink them.
- Lazy loading the main hero image, which slows Largest Contentful Paint.
Key terms
- WebP
- A modern image format from Google that usually produces smaller files than JPG or PNG at similar quality, and supports transparency. All current browsers support it, which makes it a good default for website images.
- Core Web Vitals
- Google metrics for real user experience: Largest Contentful Paint for loading, Interaction to Next Paint for responsiveness and Cumulative Layout Shift for visual stability. Good thresholds are 2.5 seconds, 200 milliseconds and 0.1.
- HTML
- HyperText Markup Language, the standard language that structures web pages with elements such as headings, paragraphs, links and images. Search engines read the HTML to understand page content, links and metadata.
- Search engine optimisation
- The practice of improving a website so it ranks higher in unpaid search results. It covers technical health, on-page content, links and user experience, and it follows Google Search Essentials rather than shortcuts.
- Browser based tool
- A tool that runs entirely in your web browser with JavaScript, so the data you enter is processed on your own device. It works instantly without sign up, but it cannot fetch other websites because of browser security rules.
Related free tools
Frequently asked questions
Is the JavaScript Minifier free to use?
Yes. The JavaScript Minifier is completely free, with no sign up, no daily limit and no watermark. It is one of more than 500 free SEO and marketing tools on hasnainsanmal.com.
Is my data stored when I use the JavaScript Minifier?
No. The JavaScript Minifier runs in your browser with JavaScript, so the values and text you enter are processed on your own device and are not sent to or saved on our server.
How accurate is the JavaScript Minifier?
It follows standard rules for this format, so the output is reliable for normal input. Test the result in the place you will use it, especially for code.
Does the JavaScript Minifier work on a phone?
Yes. The tool is built for screens from 360 pixels wide, so you can use the JavaScript Minifier on a phone, tablet or computer in any modern browser.
Can I use the JavaScript Minifier for client work?
Yes. You can use the results for your own sites and for client projects. Check the output first, and keep a note of the inputs you used so you can repeat the check later.
What should I do after using the JavaScript Minifier?
Apply the result on your page, campaign or document, then measure the effect. If you would like expert help, see the SEO services or message Hasnain on WhatsApp for a free recommendation.
How we checked this guide: every step and screenshot was taken from the live JavaScript Minifier on 2 November 2026. Further reading: Google image SEO best practices.




