JSON Formatter & Validator
Format, validate, and minify JSON instantly in your browser. Syntax error detection with descriptive messages. No data sent to servers.
JSON Syntax Quick Reference
Valid JSON Data Types
string: "hello world"
number: 42 or 3.14
boolean: true or false
null: null
array: [1, 2, 3]
object: {"key": "value"}
Common JSON Errors
- ✗ Trailing comma after last item
- ✗ Single quotes instead of double quotes
- ✗ Unquoted property names
- ✗ Comments (JSON does not support comments)
- ✗ Missing comma between items
- ✗ Unescaped special characters in strings
- ✗ Mismatched brackets or braces
Frequently Asked Questions
Is my JSON data safe when using this tool?
What is JSON formatting?
What is JSON validation?
Can I format JSON with tabs instead of spaces?
Does the JSON formatter accept comments, trailing commas or single quotes?
Why did a large number change after formatting?
Can this tool validate JSON against a schema?
What the JSON Formatter does
The Protego JSON Formatter formats (pretty-prints), minifies and validates JSON in your browser using the browser's built-in JSON parser. Paste an API response, a config file or a log entry and get readable output with 2 or 4 space indentation, a compact single-line version, or a clear error message when the syntax is broken.
Nothing you paste is uploaded to a server. That matters when the JSON holds access tokens, customer records or internal configuration, which is common when you are debugging an API or a cloud resource definition.
How to use it
Pick a mode: Format / Beautify, Minify or Validate. In Format mode, choose 2 or 4 spaces of indentation.
Paste your JSON into the Input panel, or click Load Sample to try it with example data.
Click the action button (Format JSON, Minify JSON or Validate JSON).
Check the badge on the Output panel: Valid JSON, or Invalid JSON with the parser error. Use Copy Output to copy the result.
Reading the output and errors
Error messages
Errors come from your browser's own JSON parser, so the wording differs between Chrome, Firefox and Safari. Most point to the position where parsing stopped. The real mistake is often just before it: a missing comma, a trailing comma, or a quote that was never closed.
Valid is not the same as correct
Validate checks syntax only. It does not know which fields your API expects or what type each value should be. Valid JSON can still be rejected by an application that expects a specific schema.
Re-serialization side effects
Formatting parses and rewrites the data. If an object repeats a key, only the last value is kept. Integers larger than 9007199254740991 (2 to the power of 53, minus 1) can lose precision, which matters for large IDs.
Minify for transport, format for people
Minified JSON removes whitespace to save bytes in API payloads and environment variables. Formatted JSON is for reviewing, diffing and code review. The data is identical either way.