JSON Prettifier, Minifier & Validator
Paste JSON below to format, minify, or validate it.
How to use
- Paste or type your JSON into the box above.
- Click Prettify to format it with indentation.
- Click Minify to strip whitespace, or Validate to check for syntax errors.
- Copy or download the result when you're done.
What does it do?
Prettify re-formats your JSON with consistent indentation (2 spaces, 4 spaces, or a tab — your choice). Minify strips every unnecessary character so the output is as compact as possible, which is useful for embedding JSON in URLs, storing it in a single database column, or reducing API payload size. Validate checks that your input conforms to the JSON specification and points to the exact line and column of any syntax error.
Example
Minified input:
{"name":"Ada","skills":["math","logic"],"active":true} After prettifying with 2-space indentation:
{
"name": "Ada",
"skills": ["math", "logic"],
"active": true
} Common JSON errors and how to fix them
These account for the vast majority of "invalid JSON" errors. The validator points at the offending line and column, which usually makes the specific cause obvious once you know what to look for.
- Trailing comma.
{"a": 1, "b": 2,}is invalid. JSON does not allow a comma after the last item in an object or array. - Single quotes.
{'a': 1}is invalid. JSON strings and keys must use double quotes. - Unquoted keys.
{a: 1}is invalid — JavaScript object literals allow this, but JSON does not. - Missing comma.
{"a": 1 "b": 2}is invalid. Every sibling needs a comma separator. - Comments.
// like thisor/* like this */are not allowed in strict JSON (RFC 8259). Remove them or use a JSONC parser. - Smart quotes. Copy-pasting from a word processor
sometimes replaces
"with"or", which JSON rejects. Retype the quotes or paste through a plain-text editor first.
Is my data private?
Yes. We don't save any of the JSON you paste here. Nothing is stored, logged, or retained — whatever you run through Prettify, Minify, or Validate is discarded the moment you close or refresh the tab. There's no record on our side of your payloads. Feel free to verify in your browser's developer tools.
Frequently asked questions
Why is my JSON showing as invalid when it looks fine?
Most "invalid" errors come from one of four causes: a trailing comma after the last item in an array or object, single quotes instead of double quotes, unquoted object keys, or a missing comma between items. The validator points to the exact line and column of the problem so you can jump straight to it.
What is the difference between prettify and minify?
Prettify re-formats JSON with indentation and line breaks so it is easy to read. Minify removes all whitespace so the output is as small as possible, which is useful for embedding JSON in URLs or reducing network payload size. Both produce semantically identical JSON — only the whitespace differs.
Can this tool handle very large JSON files?
Yes, up to the limits of your browser. Modern browsers can parse JSON files into the tens of megabytes without trouble. The bottleneck is usually rendering the output in the textarea, not parsing. For files over 50 MB, prettifying may pause the tab briefly.
Does this support JSON with comments (JSONC or JSON5)?
No. This tool uses the strict JSON specification (RFC 8259), which does not allow comments, trailing commas, or single-quoted strings. If you have JSONC or JSON5 input, strip the non-standard syntax first or use a dedicated parser for that dialect.
Does prettifying change the order of keys?
No. The output preserves the same key order as the input. JavaScript object iteration is ordered for string keys, and this tool does not sort or reorder anything during formatting.
Do you save the JSON I paste here?
No. We don't save any JSON you paste into the box. Whatever you prettify, minify, or validate is discarded the moment you close or refresh the page — no logs, no record on our side of your payloads. You can check your browser's developer tools if you'd like an extra layer of confidence.