Puffin'sJAVASCRIPT FORMATTER
& VALIDATOR

Paste in JavaScript or a URL, drop a file, , or load an to begin.

Shows syntax errors plus warnings for ==, var, debugger, eval, with, duplicate keys, unreachable code, and empty blocks.

Waiting for input — paste JavaScript, drop a file, or load an example.

ABOUT

Puffin's JavaScript Formatter & Validator is a free browser tool for cleaning up and checking scripts. Paste JavaScript, drop a .js file, browse from disk, load a sample, or point at a public URL — then Process to pretty-print and validate.

The checker reports syntax errors with a line and column. It reads the file as a module first, and falls back to a classic script when that is the reading that parses — so with and a legacy octal still format, with a warning. JSX is supported. TypeScript syntax is not. Warnings cover == and !=, var, debugger, eval, the Function constructor, with, an assignment used as a condition, a duplicate object key, unreachable code, an empty block, an empty catch, and a legacy octal number.

With Fix JavaScript enabled, a script that cannot be parsed is rebuilt from a best-effort parse so the rest can still be formatted. A hole the recovery cannot fill is left as /* missing */. Broken JSX is reported and left unformatted, because a guess there would rewrite the markup. Strings, comments, and number spellings stay as written. Parentheses that change meaning stay too. Nothing is uploaded to a server — processing runs in your browser (URL fetches are the exception, and may fail when the remote host blocks cross-origin requests).