JS Formatter / Minifier
How to use
A lightweight JavaScript/TypeScript helper that strips comments and extra whitespace to minify code, or re-indents it based on bracket depth to make it readable again. It is not a full parser like Prettier, so treat it as a quick cleanup tool rather than a replacement for a proper build pipeline.
Lightweight whitespace/comment-based formatter, not a full parser like Prettier or Terser. Works best on typical, syntactically valid code.
Result will appear here...- Quickly re-indenting a tangled snippet of JavaScript pasted from a chat or forum post
- Shrinking a script before pasting it somewhere space-constrained, like a bug report or config field
- Getting a rough readable view of minified third-party code before digging into it
- Cleaning up a small TypeScript snippet without pulling a build tool into a one-off task
Free and private. Everything runs on your own device, with no account and no uploads.
Sometimes you just need to quickly re-indent a tangled snippet of JavaScript or shrink a script before pasting it somewhere space-constrained, without pulling in a full build tool. This is a lightweight formatter that strips comments and extra whitespace to minify code, or re-indents based on bracket depth to make it readable again, a fast pocket tool rather than a full parser-based formatter like Prettier.
No, this is a lightweight, bracket-depth-based re-indenter and whitespace/comment stripper, not a full AST-based parser like Prettier, so it will not catch or fix syntax errors and may not perfectly format every edge case (template literals, complex JSX, etc).
No, it only strips comments and unnecessary whitespace, it does not perform variable renaming or dead-code elimination like a dedicated bundler minifier (e.g. Terser) would.
Basic TypeScript syntax is handled reasonably well since formatting is based on brackets and structure rather than full type parsing, but very complex generics or type-level code may not indent perfectly.
- 1
Paste your JS or TS code
Add the script or snippet you want to clean up.
- 2
Choose Format or Minify
Pick re-indentation for readability or minification for size.
- 3
Review the result
Check that the output still looks correct for your snippet.
- 4
Copy the code
Copy the formatted or minified code back into your project.
- ·Treat this as a pocket tool, not a Prettier replacement, it will not catch syntax errors or perfectly handle complex JSX or template literals.
- ·Do not rely on it in a CI pipeline in place of Prettier or ESLint since it does not enforce a verified style guide.
- ·Minify mode only strips comments and whitespace, it will not rename variables or eliminate dead code like a bundler minifier would.