JSON common tasks

If you’re dealing with APIs, logs, or config, you mostly need the same few operations over and over: format, minify, and validate.

Use the tool

Paste JSON into the formatter to get clean output, optional key sorting, and copy-ready results.

1) Validate JSON

“Valid JSON” means:

  • Double quotes for strings (not single quotes)
  • No trailing commas
  • Only allowed types: objects, arrays, strings, numbers, booleans, null
2) Format (pretty print)

Formatting makes JSON readable. Common indent sizes are 2 or 4 spaces.

3) Minify

Minifying removes whitespace. It’s useful when you want to reduce payload size or store a value inline.

4) Sort keys (diff-friendly)

Sorting keys makes diffs cleaner when comparing two JSON blobs. It changes property order (which is usually fine for JSON), so you probably only want it for debugging/diffing.

Example snippet
{"b":2,"a":1,"nested":{"z":true,"y":false}}

Format it, then turn on “sort keys” to normalise ordering.