Developer Tools

JSON Workbench: How to Format, Validate and Compare JSON

Fix invalid JSON fast, explore large payloads and diff two API responses.

JSON Workbench: How to Format, Validate and Compare JSON
On this page
  1. Formatting and minifying
  2. Validating and fixing errors
  3. Exploring with the tree view
  4. Comparing two documents
  5. Tips
  6. Common mistakes
  7. Conclusion

JSON is everywhere: API responses, configuration files, logs and exports. Most of the time it’s fine, until a single trailing comma breaks a deployment or two API responses differ in a way you can’t spot by eye. A good JSON tool turns those frustrating moments into quick fixes.

Here’s how to use the free JSON Workbench for everyday JSON tasks.

Formatting and minifying

Paste JSON into the editor and press Format to indent it neatly (2 spaces, 4 spaces or tabs). Turn on Sort keys to order object keys alphabetically, which makes documents easier to compare. Minify removes all unnecessary whitespace for compact storage or transmission.

Validating and fixing errors

The workbench validates as you type. When something’s wrong, it reports the line, column and a plain-English explanation, then Go to error jumps straight there. Common issues it catches:

  • Trailing commas: [1, 2,]
  • Single quotes instead of double quotes: {'name': 'x'}
  • Unquoted keys: {name: "x"}
  • Comments, which aren’t allowed in strict JSON
  • Values like undefined or NaN, which aren’t valid JSON

JSON Workbench validates strict JSON as defined in RFC 8259, the format APIs expect. JSON5 or JSONC (JSON with comments) files used by some tools are intentionally reported as invalid.

JSON WorkbenchFormat, validate, explore and diff JSON. Free, no sign-up.Try it free on HandyBear

Exploring with the tree view

Large payloads are hard to read as text. The Tree tab shows objects and arrays as collapsible nodes, with item counts when collapsed, so you can drill into exactly the part you need. Expand or collapse everything with one click.

Comparing two documents

The Compare tab takes an original and a changed document and shows:

  1. A structural diff listing each added, removed or changed value by its path, such as $.user.address.city.
  2. A side-by-side line view with keys sorted, so reordered keys don’t show up as noise.

This is ideal for checking what changed between two API versions, staging and production configs, or before and after a migration.

Tips

  • Sort keys before saving config files to version control to keep diffs readable.
  • Minify only for transport; keep formatted copies for humans.
  • Paste sensitive payloads with confidence: everything runs locally in your browser.

Common mistakes

  • Copying JSON from a JavaScript file that contains comments or trailing commas.
  • Comparing documents without sorting keys and drowning in false differences.
  • Editing minified JSON by hand.

Conclusion

Format to read, validate to fix, use the tree to explore and compare to understand changes. JSON Workbench is free, fast and private, which makes it safe for API keys and customer data.

JSON WorkbenchFormat, validate, explore and diff JSON. Free, no sign-up.Try it free on HandyBear
HandyBear Team

The HandyBear team writes practical, no-fluff guides to help you get everyday digital jobs done with free tools.

All articles →