AlpaKit Logo AlpaKit

JS/JSON Minifier & Obfuscator

Compress, beautify, and obfuscate JavaScript/JSON code locally, showing size comparison.

Source Code Input
Processed Output

📊 Code Metrics

Original Size 0 B
New Size 0 B
Ratio 0.0%

How to use this tool

  1. 1 Open JS/JSON Minifier & Obfuscator, then enter, paste, or choose the content you want to process.
  2. 2 Adjust the available options and output format for your task.
  3. 3 Review the instant result, then copy or download the available output.

Common use cases

Compress, beautify, and obfuscate JavaScript/JSON code locally, showing size comparison. Use it for everyday work, development, learning, or quick verification.

Privacy and data handling

This tool runs in your browser. Before working with sensitive data, make sure you trust your browser and device environment.

Minifying, beautifying and obfuscating JavaScript: uses and limits

Minifying JavaScript removes comments, indentation and line breaks without changing what the code does, so files get smaller and pages load faster. Beautifying does the opposite: it re-indents code squashed onto one line so you can read a third-party script or debug it. This tool puts both on one page, together with a simple obfuscator. Paste your code and it shows the original size, output size and compression ratio instantly.

To be upfront, the tool uses lightweight regular expressions rather than parsing your code into a syntax tree as Terser or esbuild do. Minifying removes /* */ and // comments, collapses whitespace and strips spaces around operators. That is handy for small scripts, bookmarklets and embed snippets, but a few cases can break: a string containing “//”, such as a URL like "https://...", is mistaken for a comment; code that relies on automatic semicolon insertion may fail once line breaks are merged; regex literals and template strings can also be affected. Keep the original file and test the output before deploying.

Obfuscation encodes your code as Base64 and wraps it in eval; JSON input is wrapped in JSON.parse instead. That stops people reading the source at a glance, but it only hides it rather than protecting it: anyone can decode it in seconds, the file grows by about a third, and code that uses eval may be blocked by a site’s Content Security Policy. Never put API keys or passwords in front-end code and expect obfuscation to protect them.

For production projects, minify automatically in your build with Vite, esbuild or Terser, which safely shorten variable names and remove dead code. This tool is best for quick one-off snippets, checking how small code can get, or unpacking someone else’s minified code to read it. Everything runs in your browser and your code is never uploaded.

Frequently asked questions

My code broke after minifying. What now?

The tool minifies with regular expressions, so “//” inside strings, code without semicolons or regex literals can be mishandled. Go back to the original, add semicolons, or use an AST-based tool such as Terser or esbuild.

Does obfuscation protect my source code?

Only from casual reading. Base64 is trivial to decode and the result needs eval to run. Never keep secrets in front-end code.

Can beautify make minified code readable?

It re-indents code at braces and semicolons so it is easier to read, but shortened variable names cannot be restored.

Is my code uploaded?

No. Minifying, beautifying and obfuscating all run in your browser.

Browse this category: Dev Tools

Suggested & Recent Tools
    ↑ ↓ Navigate ↵ Open ESC Close
    咩~
    Alpa Idle Alpa Walk 1 Alpa Walk 2 Alpa Walk 3 Alpa Walk 4 Alpa Dizzy Alpa Sleep