Skip to content
Run here 100% in your browser, no upload, no login

JavaScript Formatter

Basic JS beautify and minify in your browser; strings, templates and comments stay intact.

How to use it

  1. Paste JavaScript into the left panel - snippets, modules or bookmarklets all work.
  2. Pick the mode: Beautify re-indents with two spaces and breaks lines after braces and semicolons; Minify removes comments, indentation and blank lines.
  3. Click Convert, or keep typing - the result refreshes as you edit.
  4. Use Copy or Download to take the result with you.

Common use cases

Why it stays private

The whole pipeline is a small lexer running in your browser tab. Source code, credentials embedded in scripts and proprietary logic never leave your device.

FAQ

Q: Is this an AST-level formatter like Prettier? A: No, and the page says so up front. It re-lays-out code lexically: line breaks after braces and semicolons, two-space indentation, comment and string content preserved. It will not match Prettier on complex style rules.

Q: Can it break my code? A: Re-layout never changes tokens, so it is safe in the common case. The known limits: it does not detect regex literals, and minify keeps statement boundaries intact instead of joining lines, so ASI-sensitive code stays on separate lines.

Q: Why does minify keep the line breaks? A: Joining statements onto one line without a real parser risks changing automatic-semicolon-insertion behavior. Keeping line boundaries is the conservative choice for a lexical tool.

Your data stays on this device

JavaScript Formatter runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.