JSON Formatter & Validator
Pretty-print, minify, validate, and tree-inspect any JSON — free & instant
Paste into the left panel, upload a file, or click Sample to try it out
Paste messy, minified, or unknown JSON and instantly get a clean, indented, validated version. Switch to tree view to browse nested structures interactively, or minify for production. Syntax errors are highlighted with exact line and column numbers.
How to Format and Validate JSON
Paste your JSON to instantly format, validate, and inspect it — free and instant.
Paste your JSON
Type or paste any JSON — minified, pretty-printed, or partial — into the input. Broken JSON is flagged immediately with the exact line and column of the error.
Choose your view
Switch between formatted (pretty-printed) view, minified view, and interactive tree view. Collapse and expand nested objects and arrays in tree mode.
Copy or download
Copy the formatted JSON to clipboard or download as a .json file. Use the minified version directly in production or APIs.
Features
Runs entirely in your browser — your JSON never leaves your device
Live formatting updates as you type — see results immediately
Pretty-print with 2-space, 4-space, or tab indentation
Minify to a single line for production use or API payloads
Instant syntax error detection with exact error message
Upload a .json file and download the formatted result
Works with minified, partial, or poorly indented JSON
Free, no sign-up, no file size limits
Related Tools
Frequently Asked Questions
Does my JSON get uploaded to a server?
No. Formatting uses JavaScript's built-in JSON.parse() and JSON.stringify() — entirely local. Your data never leaves your device.
What indentation options are available?
2 spaces (default), 4 spaces, and tab indentation. Switch between them using the Indent selector — the output updates immediately.
Can I minify JSON to remove all whitespace?
Yes. Switch to Minify mode. The output is a single-line JSON string with all whitespace removed, ready for use in API payloads or configuration files.
What does the error message mean?
If your input is not valid JSON, the input panel turns red and shows the parse error — typically including the character position where parsing failed. Common causes: trailing commas, single-quoted strings, unquoted keys, or comments (JSON does not support // or /* */ comments).
Can I format JSON with comments or trailing commas?
Standard JSON does not allow comments or trailing commas. If your file uses JSON5 or JSONC, strip those first before formatting.
Is there a file size limit?
No hard limit. Very large JSON files may take a moment to format, but there is no artificial cap.