Browser Info Checker
Your browser, engine, platform, languages and what it supports.
Re-indent JavaScript, with strings and regular expressions left alone.
This fixes indentation, statement breaks and spacing, and leaves everything else where you put it. A full reprinter needs a parser and rewrites code nobody asked it to touch.
The JavaScript Formatter works from tokens rather than patterns, which is what lets it tell a division from the start of a regular expression — the one genuinely hard part of reading JavaScript, and the one that mangles code when it goes wrong.
Paste JavaScript and get it back indented: blocks nested properly, statements on their own lines, and spacing normalised around operators and punctuation. It is the fastest way to make a minified bundle or a one-line snippet readable.
The formatter works from tokens rather than patterns, which is what makes it safe. The genuinely hard problem in JavaScript is telling a division from the start of a regular expression — they look identical and only the preceding token decides — and getting that wrong mangles code silently. Strings, template literals with nested expressions, and both comment styles are all preserved byte for byte.
A regex and a division look identical and only the preceding token decides. The formatter tracks it, so neither is corrupted.
Including template literals with nested expressions, which can themselves contain backticks.
It fixes indentation, statement breaks and spacing, and leaves your choices alone. A full reprinter rewrites code nobody asked it to touch.
Arrow functions, optional chaining, nullish coalescing and the logical assignment operators all tokenise correctly.
Token, string, comment and regex counts, so you can confirm nothing was lost in the round trip.
Minified code, a snippet, or something inconsistently formatted.
Two spaces, four spaces or a tab.
Token, string, comment and function counts confirm nothing was lost.
Take it to your clipboard or download it as a .js file.
No, and deliberately. It fixes indentation, statement breaks and spacing, and leaves everything else where you put it. A full reprinter needs a parser and rewrites code nobody asked it to touch.
No. Telling a regex from a division is the one genuinely hard part of tokenising JavaScript, and the formatter tracks the preceding token to decide — so both are preserved exactly.
Yes — arrow functions, template literals with nested expressions, optional chaining, nullish coalescing and the logical assignment operators are all tokenised correctly.
No. Minifiers discard the original names and nothing can bring them back. Formatting makes the structure readable, which is usually enough to follow what the code does.
What people who use the JavaScript Formatter think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JavaScript Formatter. It takes half a minute and no account.
Write the first reviewYour browser, engine, platform, languages and what it supports.
Convert CSV or a spreadsheet paste into a padded Markdown table.
Break an emoji into its code points, modifiers and joiners.
Hash a password with bcrypt, or check one against an existing hash.
Generate C# classes with System.Text.Json attributes from a JSON sample.
Strong random passwords and passphrases, generated locally.
Draw a grid layout and get the CSS, including named template areas.
Check any number against the Luhn checksum and see the working.