πŸ—‚ JSON Formatter & Validator

Paste JSON to format, minify, or validate it instantly. All processing happens in your browser.

πŸ”’ Runs entirely in your browser β€” nothing is sent to any server
Input JSON
 
Output
 
Tips for working with JSON
πŸ”‘
Keys must be double-quoted
Unlike JavaScript objects, JSON requires double quotes around every key. Single quotes and unquoted keys are the most common source of parse errors.
🚫
No trailing commas
JSON does not allow a comma after the last item in an array or object. Most linters catch this β€” use Validate to confirm before sending to an API.
πŸ“¦
Minify for production
Stripping whitespace cuts JSON payload size by 20–40%. Use Minify when embedding JSON in HTML, config files, or API responses where every byte counts.
πŸ”
Format before debugging
A compact API response is unreadable. Paste it here first to expand the structure, then trace the exact key path causing your error.
Frequently asked questions
What is the difference between formatting and validating JSON? +

Formatting (prettifying) takes valid JSON and adds consistent indentation and newlines to make it human-readable β€” the data itself is unchanged. Validating checks whether the JSON is syntactically correct at all: proper quotes, no trailing commas, balanced brackets. You can format without validating (the tool does both), but invalid JSON cannot be formatted.

Does this tool send my JSON to a server? +

No. All formatting, minification, and validation happens entirely inside your browser using the built-in JSON.parse() and JSON.stringify() APIs. Your data never leaves your machine β€” it is safe to paste API keys, credentials, or private config here.

Why does my JSON fail to parse even though it looks correct? +

The most common invisible culprits are: trailing commas after the last item in an array or object, single quotes instead of double quotes, comments (JSON has no comment syntax β€” remove // and /* */ blocks), and invisible unicode characters copied from Word or PDF documents. Use Validate to see the exact error position.

What is the difference between JSON and JSONC? +

JSONC (JSON with Comments) is a superset used by tools like VS Code's tsconfig.json and launch.json. It allows single-line (//) and block (/* */) comments, and sometimes trailing commas. Standard JSON parsers reject JSONC. If your file uses .jsonc extension, strip comments before validating here.

How do I pretty-print JSON from the command line? +

Use jq '.' file.json for full-featured formatting, or Python's built-in: python3 -m json.tool file.json. For Node.js: node -e "console.log(JSON.stringify(require('./file.json'),null,2))". For quick one-off work, pasting here is faster than installing jq.