JSON Formatter and Validator
Pretty print, validate, minify, and explore JSON. Errors get pinpointed to the exact line and column. Tree view for big payloads. Everything stays in your browser.
Input
0 charsOutput
idleWhat is the JSON Formatter?
JSON Formatter is a free in-browser tool that pretty-prints, minifies, validates, and visualizes JSON. Paste any payload and it tells you instantly whether it is valid, points to the exact error position when not, and lets you switch between formatted, minified, and tree views without round-tripping through any server.
How to use it
- Paste your JSON into the left pane.
- Pick Pretty, Minify, or Tree on the toolbar.
- Choose indent size: 2 spaces, 4 spaces, or tabs.
- Click Copy to copy the result, or Download to save as
formatted.json.
Features
- Validate with line and column on errors.
- Pretty print with 2 / 4 / tab indentation.
- Minify to remove all whitespace.
- Tree view with collapsible nodes and key/value counts.
- Stats: size, lines, keys, max depth.
- Syntax colors for keys, strings, numbers, booleans, null.
- One click sample, paste, clear, copy, download.
JSON quick reference
JSON (JavaScript Object Notation) is a lightweight data format. Six value types: string, number, boolean, null, array, object. Strings use double quotes only. Trailing commas are not allowed. Keys must be quoted strings.
FAQ
Does my data leave the browser?
No. All parsing and formatting happen in your browser using the built-in JSON API. No network request is made for your input.
What is the maximum size?
Up to about 50 MB before the browser slows. For larger files, prefer minify and tree view over pretty mode (pretty doubles the size in memory).
Can it handle JSONC (JSON with comments) or trailing commas?
No. This tool follows strict RFC 8259 JSON. To format JSONC, strip comments and trailing commas before pasting.