JSON, HTML, CSS, SQL & XML Formatter

Beautify or minify JSON, HTML, CSS, SQL and XML in one place. Paste your code, pick the language and copy clean, indented output.

About JSON, HTML, CSS, SQL & XML Formatter

This formatter cleans up code in five languages: JSON, HTML, CSS, SQL and XML. Select a language, paste your code on the left and the formatted version appears on the right. JSON is parsed and re-indented with two spaces, so invalid JSON shows an error message that helps you find syntax problems. HTML and XML tags are placed on separate indented lines, CSS rules get one declaration per line, and SQL statements are broken onto new lines at keywords such as SELECT, FROM, WHERE, JOIN and ORDER BY.

The Minify button does the opposite: it strips whitespace and, for CSS and HTML, removes comments to make the output as compact as possible. The formatters are lightweight and rule-based, so they work best on typical code rather than unusual edge cases. Everything runs in your browser.

How to use it

  1. Pick JSON, HTML, CSS, SQL or XML.
  2. Paste your code into the input editor.
  3. Click Beautify & Indent or Minify Code.
  4. Copy the result from the output editor.

Questions

Does it validate JSON?

It checks that JSON can be parsed. If it cannot, you see the parser error message instead of formatted output. It does not validate against a JSON Schema.

Can it format JavaScript, Python or other languages?

No. Only JSON, HTML, CSS, SQL and XML are supported.

Is my code sent anywhere?

No. Formatting and minifying happen in your browser.

More Developer & Code tools

Home · All Tools · Blog