JavaScript Compression Tool
Minify and restore readable JavaScript format
Language
語系:繁體中文
语言:简体中文
Language: English
Ngôn ngữ: Tiếng Việt
言語:日本語
Settings
Compress
Restore Format
Paste
Sample
Clear
Use Output
Compress Now
Input JavaScript
0 B · 0 lines
Output
0 B · 0 lines
Copy
Download
Processing
Settings
Restore Format Settings
Indent size
2
4
8
Number of characters used for each indentation level. Default is four spaces.
Indent character
Spaces
Tab
Choose spaces or tab characters for indentation.
Brace style
collapse
expand
end-expand
preserve-inline
Controls whether opening and closing braces stay on the same line or move to separate lines.
Maximum line length
Use 0 to disable forced line wrapping.
Maximum preserved blank lines
Limits consecutive blank lines retained from the original source.
Preserve line breaks
Keeps reasonable line break locations found in the input code.
Spaces inside parentheses
Adds spaces immediately inside parentheses where supported.
End with newline
Adds a final newline at the end of the output file.
Compression Settings
ECMAScript target
ES5
ES2015
ES2020
ES2024
Controls output syntax compatibility. It does not transpile newer syntax to older browsers.
Compression passes
1
2
3
More passes may reduce size slightly but require more browser processing time.
Comment policy
Keep license comments
Keep all comments
Remove comments
License mode retains comments containing license, preserve, copyright or leading exclamation marks.
Enable code compression
Applies safe Terser compression transformations in addition to whitespace removal.
Shorten variable names
Renames local variables to shorter names to reduce output size.
Optimize top level
Allows top-level declarations to be removed or renamed. Enable only when the file is self-contained.
ES module mode
Enable when the input contains import or export module syntax.
Keep function names
Useful when code depends on Function.name or stack trace readability.
Keep class names
Useful when code depends on class names at runtime.
Remove console calls
Removes console calls. Do not enable if console output has functional side effects you need.
Remove debugger statements
Removes debugger statements from compressed output.
Preference Settings
Remember settings with cookies
Stores only language and tool preferences in your browser cookie. Source code is never stored in cookies.
Reset settings