JSON Formatter & Validator
Pretty-print, minify and validate JSON with clear, line-by-line error messages.
Processed locally
Paste JSON and press Format, Minify or Validate. Or try the .
Instructions
How to use it
- 01Paste or type JSON into the Input box, or load the sample.
- 02Press Format (or Ctrl + Enter) for readable, indented output, or Minify to strip all whitespace.
- 03If something's wrong, you'll see the line, column and a likely fix. Show me jumps to it.
- 04Copy the result with one click.
About
What it does
JSON is the text format most APIs, config files and databases use to exchange data. It's strict: keys need double quotes, trailing commas are forbidden and comments aren't allowed. One stray character makes a whole document invalid.
This formatter reads your input character by character against the JSON standard (RFC 8259). Unlike tools built on JSON.parse, it keeps every value exactly as written, so a 20-digit ID stays a 20-digit ID and 1.50 doesn't become 1.5. Only whitespace changes.
Settings explained
- Indent
- 2 spaces is the most common style; 4 spaces suits deeply nested data; tabs let each reader choose their own width.
- Validate
- Checks the JSON without changing the output, and warns about legal-but-risky things like duplicate keys and numbers too large for JavaScript.
Good for
- Reading a minified API response while debugging
- Finding the trailing comma that broke a config file
- Minifying JSON before embedding it in a request or environment variable
- Checking that hand-edited data is valid before committing it
Questions, answered
- Is my JSON sent anywhere?
- No. Parsing and formatting happen in JavaScript inside your browser tab. Nothing you paste is uploaded, logged or stored.
- Will formatting change my data?
- No. Only whitespace changes. Numbers, strings, escape sequences and key order are kept exactly as you wrote them, including very large integers and duplicate keys that many formatters silently alter.
- Why is my JSON invalid?
- The most common causes are trailing commas, single-quoted strings, unquoted property names and comments. These are allowed in JavaScript but not in JSON. The validator points to the exact line and column and suggests a fix.
- What's the difference between formatting and minifying?
- Formatting adds line breaks and indentation so JSON is easy for people to read. Minifying removes all unnecessary whitespace so it's as small as possible for sending or storing.
Related tools
All developer tools (5)- XML Formatter & ValidatorFormat, minify and check XML for well-formedness, with errors that point to the exact line.
- CSV ↔ JSON ConverterTurn CSV into JSON or JSON into CSV, with proper handling of quotes, commas and headers.
- Base64 Encoder / DecoderEncode text to Base64 or decode it back, with full Unicode and URL-safe support.
- HTML Escape / UnescapeEscape HTML special characters so code displays safely, or turn entities back into text.