DevToolCase
Sign in Sign in

Format and validate JSON

Indent or sort JSON and find the exact line of a syntax error; minify it in one click.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

What does a JSON formatter do?

APIs, logs and database exports often deliver JSON on a single line, impossible to read. Formatting indents it so that its structure shows at a glance; validating tells you whether it is correct JSON and, if not, the exact line and column of the first error.

“Sort keys” puts the keys of every object in alphabetical order: handy to compare two JSON documents that hold the same data in a different order.

The most common JSON errors

  • A trailing comma after the last item: {"a": 1,}.
  • Single quotes instead of double quotes: {'a': 1}.
  • Keys without quotes: {a: 1} is valid JavaScript, not JSON.
  • Comments, which JSON does not allow, neither // nor /* */.
  • Values JSON does not know: undefined, NaN, or a number with a leading zero such as 007.

Under the error message, “Show in the input” puts the cursor on the faulty character, even in a file of thousands of lines.

Format, minify or convert?

Format to read and debug. To send or store JSON, minify it: without spaces and line breaks, it is often a quarter smaller.

Need another format? Turn it into YAML for a configuration file, or into CSV to open it in Excel.

Is my JSON sent anywhere?

No. Formatting and validation run in your browser: what you paste never leaves your device, which matters for access tokens, customer data or production logs.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.