JavaScript Formatter
Format or minify JavaScript.
LocalYour data is processed locally in your browser and is not uploaded to Alphzen.
Source is tokenized, not executed. Minify only removes comments and extra whitespace — it does not mangle names.
Paste source to format.
How to use
- Paste JavaScript (not a full webpack bundle unless you accept slower formatting).
- Format to indent braces, or Minify to strip comments and extra whitespace.
- Copy the result. The code is never eval’d.
Features
- Does not execute your script in the Alphzen page.
- Tokenizer respects strings, comments, templates, and regex literals after operators.
- Minify is whitespace/comment removal — it does not mangle names.
- Not a substitute for Prettier or Terser on a production build.
- Local processing only.
Examples
function add(a,b){return a+b;}FAQ
Is my code executed?
No. There is no eval, no Function constructor, and no iframe runner. That is a hard product rule.
Will minify break ASI edge cases?
Possibly. Automatic semicolon insertion plus aggressive whitespace removal is unsafe in some files. Prefer Format for reading; use Terser in your build for shipping.
TypeScript or JSX?
Type annotations and JSX are not first-class. Simple files may still indent; treat the output as a starting point.
Related tools
About this tool
A JS formatter should never run the input. Alphzen tokenizes source and reprints whitespace. That is slower than a glance and safer than pasting into a console.
Minify here is not Terser: identifiers stay, dead code stays. Use it to shrink a snippet, not to ship a production bundle.
JSON is not JavaScript. For JSON documents use JSON Formatter, which actually parses JSON.