ToolBuddy
In Browser

JavaScript Formatter

Beautify or compact JavaScript in the browser. Re-indent minified snippets from DevTools, or collapse whitespace for a rough size check. Formatting stays on-device so proprietary scripts are never posted to a beautifier.

Runs in your browser. Nothing is uploaded.

Loading tool…

About this tool

Beautify JavaScript with js-beautify or compact it for a rough size check. Minify here is a compact pretty-print, not a production pipeline like Terser. Keep CI minifiers for shipping bundles. Proprietary scripts stay in the tab instead of a 'JS pretty print' upload form.

How to use: paste a snippet, pick Beautify or Minify, choose 2- or 4-space indent, copy. Handy for DevTools copy, bookmarklets, and inline handlers you want to read. If beautify throws, you get the original back with a note.

Example: a one-line IIFE becomes indented functions and blocks. Comments survive beautify. This is not a linter and not Babel. Syntax that js-beautify cannot parse is returned unchanged.

Source never goes to a formatter SaaS. After load, formatting works offline. Related: JSON formatter for data, HTML/CSS formatters for markup. Indent 2 spaces unless your repo standard is 4.

Related Web tools