Questions and answers

Does formatting change what the page does?

Tags, attributes, comments and words stay as written; only whitespace changes. A run of spaces or line breaks in text becomes one space, which is how a browser shows it anyway, and elements go on lines of their own, which can add a small gap between inline-block elements. The content of pre, textarea and SVG text elements is left untouched. Text that CSS sets to keep its spaces (white-space: pre) cannot be recognised from the markup, so check such pages after formatting.

What happens to the CSS and JavaScript in the page?

The content of style and script elements is formatted too, by the same engines the CSS Formatter and the JavaScript Formatter use, and indented to the depth of the element holding it. A script the JavaScript engine cannot format without changing it is kept as written.

Can it format a broken or partial page?

Yes. It is not a validator: an unclosed tag or a fragment without html and body is indented as it is, so you can tidy a template or a snippet as easily as a whole page.

Is my markup uploaded anywhere?

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

  • CSS Formatter Indent minified CSS, one declaration per line, with the rules spaced out.
  • JavaScript Formatter Indent minified or crowded JavaScript without moving a single token.
  • 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