Questions and answers

Can formatting break my code?

It only changes whitespace, and checks that it did: the result is read back token by token and must match your code, or no result is shown. No semicolon is inserted, and a line break that ends a statement, such as one right after return, is kept, so code that relies on automatic semicolon insertion keeps behaving the same. Strings, template literals and regular expressions are copied through untouched.

Does it work on minified or bundled files?

Yes, and it is the usual reason to use it: a one-line bundle becomes readable. Names that the minifier shortened stay short, because the original names are not in the file any more.

Does it handle modern syntax?

Classes with private fields, optional chaining, nullish coalescing, async generators and import and export statements are all indented as the structures they are. It formats JavaScript: TypeScript type annotations are treated as ordinary expressions, and JSX is usually reported as code it cannot read.

Is my code uploaded anywhere?

No. It is formatted in this browser tab, in a background worker, and never leaves your device.

  • HTML Formatter Indent minified or tangled HTML, including the CSS and JavaScript inside it.
  • CSS Formatter Indent minified CSS, one declaration per line, with the rules spaced out.
  • JSON Formatter Format, validate and minify JSON, with the exact line and column of any error.
  • JSON Minifier Minify JSON to one line without spaces, keeping numbers and strings exactly as written.

More Developer tools