All tools · Utilities

JSON Formatter

Validate, beautify, or minify JSON.

Free to use, no sign-up required. JSON Formatter is one of 198 tools built into Xenition, alongside a chat that can use them for you.

Checks whether text is valid JSON and reformats it, either indented for reading or minified onto one line. Use it on API responses, config files or logs.

How to use JSON Formatter

  1. Paste your JSON into the box.
  2. Look at the status line: “Valid JSON ✓” or “Invalid:” followed by the parser’s message.
  3. Choose Beautify for two-space indentation or Minify for a single compact line.
  4. Press the copy button on the result.

How it works

The text is parsed with the browser’s JSON.parse, which follows the strict JSON standard, then written back with JSON.stringify using a two-space indent for Beautify or none for Minify. Error messages come from the browser, so their wording can vary between browsers.

Example

{"name":"Ada","langs":["en","fr"],"active":true} beautifies to eight lines with each key and array item on its own line. Pasting {"a":1,} fails with a message about an expected double-quoted property name, because JSON does not allow a trailing comma.

Questions about JSON Formatter

Why is my JSON invalid when it works in JavaScript?

JSON is stricter: keys and strings need double quotes, trailing commas and comments are not allowed, and values such as undefined or NaN do not exist.

Does formatting change my data?

Only whitespace changes. If a key appears twice, the parser keeps the last value, so the output then has only one copy.

What it takes

Use it from chat

You do not have to open JSON Formatter to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.

Related tools