JS 圧縮・保護ツール
NewJavaScriptコードのMinify、難読化、AES-256暗号化保護ツール。
圧縮、難読化、パックはセキュリティ保護ではありません。保護が必要な場合は暗号化(AES)を使用してください。
不要な空白やコメントを削除してファイルサイズを削減します。
このツールについて
JavaScript code protection covers a spectrum of techniques: minification (removing whitespace and comments to reduce file size), obfuscation (renaming variables and restructuring code to make it harder to read), packing (wrapping code in a self-decoding bundle), and encryption (using a password-based cipher so the content cannot be read without the key). This tool offers all four modes for free, directly in your browser, as a lightweight alternative to paid commercial obfuscators like Jscrambler for quick one-off protection needs. Understanding their security levels is critical: minification, obfuscation, and packing do not prevent a determined developer from reading your code. Real protection—where the code is unreadable without a secret—requires the AES-256-GCM Encrypt mode.
フロントエンド最適化:ASTベースのコード圧縮(Minify)とTree-shaking
Core Web Vitals向上のためのJS/CSS圧縮、コンパイラASTマングリング、不要コード削除(DCE)、ESモジュールによるTree-shaking、および本番Source Mapのセキュリティを解説します。
使い方
- 1Choose a mode: Minify, Obfuscate, Pack, or Encrypt.
- 2Paste your JavaScript into the input field.
- 3For Encrypt mode: enter a password — it is required to decrypt the output later.
- 4Click the action button to process, then copy the result with the "Copy" button.
よくある質問 (FAQ)
- What is the difference between Minify, Obfuscate, and Pack?
- Minify removes whitespace and comments—the code is shorter but still readable. Obfuscate renames variables to cryptic names—the code is very hard to understand. Pack wraps the code in a self-running decoder—an extra layer of obscurity. None of these prevent a motivated developer from reversing the output.
- What does the Encrypt mode do?
- Encrypt uses AES-256-GCM with PBKDF2 key derivation (150,000 iterations) to encrypt your code with a password. The output is a Base64 ciphertext blob that is completely unreadable without the password. The password is never stored or transmitted—if you lose it, the data cannot be recovered.
- Can I protect my JavaScript so nobody can copy it?
- Not fully. Any JavaScript that runs in a browser must be downloaded to that browser, where it can be inspected with developer tools. Minification and obfuscation raise the effort required, but server-side execution (API routes) is the only way to keep logic genuinely private.
- Why does minification sometimes break code?
- Regex-based minifiers can fail on edge cases: strings that contain comment-like patterns (e.g. "https://..."), certain template literals, or ASI (Automatic Semicolon Insertion) edge cases. For production, use a parser-based tool like Terser, which understands the JavaScript AST and cannot produce syntactically invalid output.
- Is this a free alternative to Jscrambler or other commercial obfuscators?
- For quick, one-off protection needs, yes—minify, obfuscate, pack, and AES-256-GCM encrypt are all free and run entirely in your browser. Commercial tools like Jscrambler add more advanced, harder-to-reverse transformations (control-flow flattening, anti-debugging, polymorphic code) intended for production-grade, ongoing protection of commercial applications—consider one of those if you need protection against serious reverse-engineering attempts.