Parse JSON and see how a parser reads it: as a tree of objects, arrays and values.
Loading the tool...
How to use JSON Parser
Paste JSON into the input box.
Look at the Tree view to see how it was parsed, or at the Code view for the cleaned text.
If parsing fails, follow the line number in the message.
About JSON Parser
A parser turns text into data your program can use. Here you see the result of that step: the tree of values that a JSON parser builds from your text. If the text cannot be parsed you get the reason instead.
That makes this page a quick way to find out what your code will receive, for instance whether a field is a number or a string, or whether an array is really empty or contains null.
Frequently asked questions
What is the difference between parsing and formatting?
Parsing builds the data structure. Formatting prints that structure back as text with whitespace. A formatter always needs a parser, so the two usually go together.
Why is "1" shown differently from 1?
In the tree, strings appear in green with quotation marks and numbers in blue without them. That helps you spot values that look like numbers but are actually strings.
Does the parser accept comments?
No, standard JSON has no comments. If your input has them, use the JSON5 formatter, which understands comments and trailing commas.
How are very large numbers handled?
We keep them as written. JavaScript would normally round 12345678901234567890 to 12345678901234567000, but here the original digits are preserved.