FormatterHQ

Online JSON Parser with Error Positions

A JSON parser online that checks your text against the strict grammar as you type, points to the line and column of the first error, and shows the parsed values with their types.

Loading tool…
Ready.

How to use the JSON Parser

  1. Paste JSON into the editor on the left, click Open to choose a .json file, drop a file onto the editor, or click Sample.
  2. The text is parsed as you type. If it is invalid, read the message and its line and column under the editor.
  3. Click Go to error to jump to that position, or Try Repair to fix common mistakes automatically.
  4. Once it parses, inspect the values on the Tree, Table or Graph tab and click a key to see its path and type.
  5. Use Format, Minify, Copy or Download on the editor toolbar to keep the text.

What a JSON parser online checks for you

A JSON parser online reads your text against the strict JSON grammar and, if every character fits, turns it into values: objects, arrays, strings, numbers, booleans and null. This page performs both steps while you type. It stops at the first character that breaks the grammar and says what it expected there, or, when the text is valid, it lays out the parsed values so you can check their types before your own code relies on them.

The parser shares its interface with the JSON Viewer. Use this page when the question is "will this parse, and what comes out?"; use the JSON Viewer when you mainly want to browse a large document, and the JSON Formatter when you need indented text with a choice of indent to paste somewhere else.

Reading parse errors and their positions

Parsers read from left to right, so an error is reported at the first point where the text can no longer be valid, which is not always where the mistake was made. These are the messages this page gives for common problems:

InputMessageReported at
{"a":1,}Trailing comma before '}' is not allowedLine 1, column 8
{'a':1}Property names must be wrapped in double quotes, not single quotesLine 1, column 2
{"a":1 then "b":2} on the next lineExpected ',' or '}' but found '"'Line 2, column 1
{"x":NaN}NaN and Infinity are not valid JSON numbersLine 1, column 6

The missing-comma case is the one that misleads people: the comma belongs at the end of line 1, but the parser notices only when it reaches the next key on line 2. Look just before the reported position as well as at it. Columns here count from 1. Language parsers phrase the same problem differently and some add a zero-based character offset; Python, for instance, reports the trailing comma above as Expecting property name enclosed in double quotes: line 1 column 8 (char 7). When an error appears, Go to error moves the cursor to the spot and Try Repair attempts an automatic fix.

What types come out of the parser

After a successful parse, the Tree tab lists every key with its value, and the header shows the size, the maximum depth, the number of keys and the total number of nodes. Click a key and the path bar shows its JSONPath together with the parsed type, for example $.founded with number · 2014 in the sample. That is the quickest way to catch a value that arrived as the string "2014" when your code expects a number, or an empty string where you expected null. The Table tab shows arrays of objects as rows and columns, and Graph draws the nesting as connected boxes.

Parse pitfalls: big integers, duplicate keys and trailing commas

Valid JSON can still parse into something other than what was written. Paste {"id":9007199254740993,"dup":1,"dup":2,"f":1.50} and press Format; the parsed values come back as:

{
  "id": 9007199254740992,
  "dup": 2,
  "f": 1.5
}
  • Integers above 9,007,199,254,740,991. JavaScript stores every number as a 64-bit float, so the ID was rounded to the nearest value it can represent. Python's json module keeps it exact, and PHP's json_decode turns it into a float unless you pass JSON_BIGINT_AS_STRING. The dependable fix is to send such IDs as strings.
  • Duplicate keys. RFC 8259 says names within an object should be unique but does not forbid repeats, so behavior is up to the parser. JavaScript and Python keep the last value without warning. To detect duplicates in Python, pass an object_pairs_hook to json.loads.
  • Trailing commas and comments. Both are rejected by every strict parser, including JSON.parse, even though JavaScript object literals allow them. The JSON fixer removes them in bulk.
  • Number spelling. 1.50 becomes 1.5 and 1e2 becomes 100, because a parser keeps values, not their original text.

Parsing escaped JSON strings

Sometimes the text is valid JSON, just not the JSON you meant. A value copied from a log, such as "{\"a\":1}", parses successfully, but the result is one string rather than an object. The tree shows a single string at $ and the status reads Valid JSON · 0 objects, 0 arrays, depth 0. In code, the equivalent is that JSON.parse hands back a string and a second JSON.parse is needed on it. To unwrap such values here, use String to JSON, which removes one or more layers of encoding and formats the document inside.

A successful parse is not a valid shape

Parsing proves only the syntax. It does not prove that price is present, that items is an array or that status holds a value your code handles. Describe those rules once and check documents against them with the JSON Schema validator. The grammar this parser enforces is defined in RFC 8259.

Frequently asked questions

Why is the parse error reported on the line after my mistake?
A parser only knows something is wrong when it meets a character that cannot continue the document. A missing comma at the end of one line is detected at the first key of the next line, so check just before the reported position as well as at it.
What does "Unexpected end of input" mean?
The text stopped before every object or array was closed, usually because it was cut off while copying or downloading. The message names the bracket that is missing. Try Repair can add the closing brackets so you can see what is there.
Can a JSON document be just a number or a string?
Yes. RFC 8259 allows any JSON value at the top level, so 42, "text" and null are valid documents. The tree then shows a single value at $ with 0 objects and 0 arrays.
Why did my large ID change after parsing?
JavaScript parses every number as a 64-bit float, which holds integers exactly only up to 9,007,199,254,740,991. Larger values are rounded. Send such IDs as strings, or parse them with a library that supports big numbers.
Does the parser accept comments or trailing commas?
No. Strict JSON allows neither, and the parser stops at the first one with a specific message. Remove them, press Try Repair, or treat the file as JSON5 if it is a configuration file written that way.

Last updated October 3, 2026

Related tools

XML Parser Parse XML online and inspect the resulting object tree with elements, attributes and text nodes clearly separated. YAML Parser Parse YAML online and see the resulting data as JSON and a tree. Check types, anchors and multi-document files. JSON Patch Tester (RFC 6902) Apply RFC 6902 JSON Patch operations (add, remove, replace, move, copy, test) to a document and see exactly which step fails. JSON Patch Generator (Diff to Patch) Compare two JSON documents and generate the RFC 6902 JSON Patch that transforms the first into the second, with optional test ops. JSON Path Finder Click any value in a JSON tree to get its path as JSONPath, JavaScript, Python, PHP, jq or JSON Pointer — or list every path. JSON Pretty Print Pretty print JSON online with a 4-space default, 2 or 3 spaces or tabs, and see the matching JavaScript, Python, PHP and jq commands. JSON Reader Open a .json file in your browser and read it as a collapsible tree, a sortable table or a graph, with a filter to find any value. JSON Schema to Sample JSON Generate realistic fake JSON that conforms to a JSON Schema — formats, enums, ranges and required fields respected. JSON Schema Validator Validate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) with Ajv and get every error with its path and rule. JSON Serialize Online Serialize JSON into its most compact transport form, optionally wrapped as an escaped string literal for storage or messaging. JSON Sorter Sort JSON keys alphabetically at every level, ascending or descending. Optionally sort arrays of values for clean, comparable output. JSON Stringify Online Stringify JSON into an escaped string literal, exactly like JSON.stringify. Ready to embed JSON inside JSON, code or config values.