JavaScript minifier
Parse and minify a JavaScript snippet with the bundled Terser processor.
JavaScript minifier: inputs, results and limitations
Parse and minify a JavaScript snippet with the bundled Terser processor.
How to use JavaScript minifier
- Paste your text or use the example to inspect the operation.
- Run the tool once the input is ready.
- Inspect the preview or result, then download a new file.
An illustrative use case
A short JavaScript function passed through a local minifier.
Sample input
function add(a,b) { return a + b; }What to inspect in the output
Keep readable source for maintenance and test the minified script in its actual application. Removing or renaming code can expose assumptions about global variables or external consumers.
Where this tool stops
Review the output before using it. Your original input is not changed.
Troubleshooting JavaScript minifier
Check source syntax and distinguish literal characters from their escaped representation. Run the example first, then compare with your failing input to isolate the invalid part.
Questions about JavaScript minifier
Does minification prove the program works?
No. A parser can accept code whose behaviour is still wrong. Run the application tests and retain the original source.
What input does JavaScript minifier need?
Use the sample text shown below, then replace it with your own input. Review the result for the destination where it will be used.
Which options does JavaScript minifier provide?
There are no extra settings in this version. Select or paste the appropriate input and review the produced result.
Your original input is preserved. Review the new output before using it in a published page, customer delivery or production workflow.
JavaScript enables the interactive workspace.