tools/format/js beautifier
// formatnew

js beautifier

unminify and format messy js

drag & drop · up to 5 MB (Pro: 100 MB)
— paste js to start // client-only
// output appears here

// about this tool

A JS beautifier takes minified or poorly formatted JavaScript and adds proper indentation, line breaks, and spacing. It preserves string literals, template literals, comments, and regex patterns exactly, only adjusting whitespace around statements and blocks.

// when to use

  • Unminify a JavaScript bundle or library to understand its structure
  • Read obfuscated JavaScript from a web page to see what it does
  • Clean up auto-generated JavaScript before adding it to a project
  • Quickly format a snippet before reviewing it in a pull request

// faq

Why is the output not perfectly formatted?
Perfect JS formatting requires a full AST parser — tools like Prettier build a complete syntax tree before emitting output. This formatter uses a fast structural approach: it tracks braces, parens, and string boundaries without parsing the full grammar. For production codebases, use Prettier or ESLint.
Can it format TypeScript or JSX?
Basic TypeScript syntax (type annotations, interfaces) is handled. JSX tags (angle-bracket components) may not format correctly since they look like comparison operators to the formatter. For TypeScript and JSX, use the Prettier playground.
// history
Pro Cloud Sync — upgrade
no operations yet