본문으로 건너뛰기
Tools Star Hub

JavaScript 압축기

파서를 사용해 브라우저에서 JavaScript를 압축합니다. 코드는 실행되지 않습니다.

도구를 불러오는 중…

이 도구는 브라우저에서 실행됩니다. 입력값, 파일, 생성된 값은 이 기기에 남습니다. 즐겨찾기와 최근 사용한 도구를 이용하더라도 로컬 저장소에는 도구 이름만 저장되며, 비밀번호나 문서, QR 내용은 절대 저장되지 않습니다. 자세한 내용은 개인정보처리방침을 확인하세요.

이 도구의 자세한 안내(사용법, 예시, 자주 묻는 질문)는 현재 영어로만 제공됩니다.

What this tool does

Parse JavaScript with Terser, then compress and mangle it. Use it when a small script should be shorter and you want a parser rather than find-and-replace. The script is not run, and TypeScript comes back as an error.

How to use

  1. Paste JavaScript into the left box.
  2. Press Minify. A parser compresses and mangles the source without running it.
  3. Copy the result or clear both boxes. Syntax errors are shown instead of output.

Examples

  • A small function

    function greet(name) { return "Hello, " + name; } is parsed, then shortened by removing whitespace and renaming locals where safe.

  • Invalid source

    If the parser cannot read the file, you get an error. The tool does not try to “fix” broken JavaScript.

How it works

JavaScript cannot be minified safely with simple find-and-replace. This tool uses Terser in the browser to parse the source, then compress and mangle it. Your code is not executed with eval or new Function. Constant-expression evaluation is turned off so user expressions are not run during minify. Very large files are rejected so the tab stays responsive.

Limitations

Terser parses the source, then compresses and mangles it. The script is not run. TypeScript, and JavaScript the parser cannot read, come back as an error rather than a shorter file. Constant expressions are not evaluated during the pass.

See the disclaimer for what these tools do not cover.

FAQ

Is the JavaScript Minifier free?
Yes. Parsing and minifying JavaScript in this browser is free, with no account.
Does this run my JavaScript?
No. The source is parsed and rewritten. It is not executed in this page.
Will every program minify?
Only syntactically valid JavaScript. Browser-incompatible syntax or truncated files will fail with a parser error.
Is my input sent to a server?
No. The source is minified in this tab. It is not uploaded and not saved in local storage.