JSON Tools

5 free JSON utilities — formatter, validator, CSV converter, XML converter, and diff checker. All run in your browser, no signup needed.

Format, validate, and minify JSON with syntax highlighting and error detection.

What Is a JSON Formatter and Validator?

A JSON formatter (also called a JSON beautifier or JSON pretty printer) reformats compact or unindented JSON into human-readable output with proper indentation and line breaks. A JSON validator checks whether your data is syntactically correct JSON — it reports the exact line and character position of any error so you can fix it immediately.

These two operations are almost always done together: you paste an API response or config blob, the formatter makes it readable, and the validator confirms it is valid before you commit or deploy it. Minification is the reverse — stripping all whitespace to produce the smallest possible output for production APIs and config files.

Indentation Styles

2-space indent
{
  "key": "value"
}
JavaScript, Node.js, JSON configs (package.json, tsconfig.json). Most common in web projects.
4-space indent
{
    "key": "value"
}
Python-adjacent projects, Java, some style guides. More readable for deeply nested structures.
Minified (no spaces)
{"key":"value"}
Production API responses, CDN-delivered JSON, any context where payload size matters.

JSON Syntax Reference

TypeExampleRules
Object{"key": "value"}Keys must be double-quoted strings; no trailing comma after last pair
Array["a", 1, true]Ordered list; no trailing comma after last element
String"hello world"Must use double quotes — single quotes are invalid JSON
Number42 or 3.14No quotes; integers or decimals; no leading zeros
Booleantrue or falseLowercase only — True and False are invalid
NullnullLowercase only — Null and NULL are invalid

Common JSON Errors and How to Fix Them

Single quotes on keys/values
{name: 'Alice'}
{"name": "Alice"}
Trailing comma in object
{"a": 1, "b": 2,}
{"a": 1, "b": 2}
Trailing comma in array
[1, 2, 3,]
[1, 2, 3]
Comment in JSON
{"x": 1 // comment}
Remove the comment entirely
Unquoted key
{name: "Alice"}
{"name": "Alice"}
undefined or NaN value
{"val": undefined}
Use null instead: {"val": null}

Where JSON Is Used in Real Projects

JSON is the default data format for the modern web — it appears in API responses, configuration files, database records, and developer tooling. Knowing where it shows up helps you understand what format to expect and how strict the parser will be.

ContextExample files / systemsNotes
REST API responsesGitHub API, Stripe, Twilio, OpenAIMust be valid JSON; minified in production
Node.js configpackage.json, tsconfig.json, eslintrc.jsonStrict JSON — no comments, no trailing commas
Editor / IDE config.prettierrc, .vscode/settings.jsonSome tools support JSONC (JSON with Comments)
Document databasesMongoDB, Firestore, DynamoDB, CouchDBStored as BSON internally; queried as JSON
Frontend statelocalStorage, sessionStorage, IndexedDBSerialized via JSON.stringify; parsed via JSON.parse
Data interchangeWebhooks, message queues, event payloadsUsually minified; often wrapped in an envelope object

All JSON Tools

Frequently Asked Questions

Common questions about JSON Tools