JSON Workbench: How to Format, Validate and Compare JSON
Fix invalid JSON fast, explore large payloads and diff two API responses.
On this page
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
undefinedorNaN, 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.
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:
- A structural diff listing each added, removed or changed value by its path, such as
$.user.address.city. - 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.
Related articles
All articles →Gradient Lab: How to Create Beautiful Gradients for Websites and Designs
A friendly guide to gradient angles, colour stops and colour choices, plus how to copy production-ready CSS.
UTM Link Builder: How to Track Marketing Campaign Links
What UTM parameters are, a naming convention that keeps reports tidy, and how to build and export tracking links.
Contrast Checker: How to Choose Accessible Colors for Your Website
Learn what AA and AAA mean, how contrast ratios work, and how to adjust your palette so everyone can read your content.