/en/tool/json-formatter/ works tree view, repair, schema
Paste an API response, open a file, or enter a URL — the formatter will pretty-print the document with indentation. If parsing fails, it will show the line and column where the error occurred and offer to repair it. You can then use the same document in the tree view with paths, run JSONPath queries, validate it against a schema, compare it with a reference, and export it to CSV, YAML, or XML.
The expression extracts only what is needed from the document; the schema shows where the data diverged from the contract. They operate on the same document parsed above.
Understands $, a dot, ["key"], [0], [*], the [1:3] slice, and two dots — search for a key at any depth: $..id. The match counter updates on every keystroke.
Draft-07 to a practical extent: type, required, enum, const, minimum and maximum (including strict versions), minLength and maxLength, pattern, items, properties, patternProperties, additionalProperties, minItems, maxItems, uniqueItems, anyOf, allOf, oneOf, not, and $ref within the schema itself.
What was found
Expression not set
Schema validation
Schema not set
Both sides are first normalized — keys sorted alphabetically and indentation made consistent — and only then compared line by line. Otherwise, half the “differences” would be caused by a different key order.
Second document: yesterday’s response from the same method, output from the production server, or an expected sample from the tests. On the left is what was parsed in the first panel; on the right is what is shown here.
Line-by-line differences
Reference not set
Provide the document in any of three ways: paste the text into the field, drag a file onto the dashed border or the field itself, or enter an address and click “Load”. Parsing starts immediately; you do not need to click a button.
If parsing fails, the issue shows the line and column, and the button next to it moves the cursor directly to that position in the input field. The position marks where the parser realized it could not read any further; the typo itself is usually a couple of characters to the left.
Fix broken JSON from someone else’s config or from a log with the “Fix” button. It removes trailing commas, changes single quotes to double quotes, quotes bare keys, removes comments, and replaces NaN, Infinity, and undefined with null. The issues list shows exactly what was fixed; nothing is replaced silently.
The “Tree” tab is useful when a listing is impractical, such as in a response with three thousand lines. Nodes can be collapsed, and each one shows its type and number of elements. The buttons next to them copy the node path to the clipboard, both as $.items[3].id and as data["items"][3]["id"].
The CSV, YAML, and XML tabs rebuild the same document in another format. CSV is generated from an array of objects: the columns are the union of the keys, and nested data is placed back into JSON inside a cell. The “Download file” button returns whatever is shown on the current tab.
The JSONPath expression in the second panel extracts only what you need from the document: $.items[*].id returns all identifiers, and $..price returns all prices at any depth. The counter shows how many matches there are, and the listing shows exactly what matched.
JSON Schema in the same panel checks whether the document conforms to the specified contract. Violations are listed with paths, so you see not just “does not match” but “$.items[2].price: expected a number, received a string”.
Comparison with the reference in the third panel shows how two documents differ: line by line with annotations and in a separate list of paths. Key order does not affect the result; both sides are sorted.
The input data is the same as the default field values: you can calculate it mentally and confirm that the tool is telling the truth.
There are four top-level keys — name, count, tags, and meta — plus two inside meta: open and path. Six in total.
Nesting: the object itself is the first level; the tags array and meta object are the second. There is nothing deeper, so the depth is 2.
Each array element and each key-value pair goes on its own line. The array and object brackets also each take up a line.
In the tree, there are three top-level nodes with values and two collapsible nodes: tags is an array with 3 elements, and meta is an object with 2 keys. The path to the third tag is $.tags[2], or data["tags"][2].
The result is 13 lines: the opening bracket, name, count, “tags”: [, three tags, the array’s closing bracket, “meta”: {, open, path, and two closing brackets. There are 6 keys and a depth of 2. The expression $.tags[*] returns three matches. The CSV tab will not work with this document because CSV is generated from an array of objects, while the root here is an object.
Because the JSON standard does not allow it. Trailing commas are allowed by JavaScript, JSON5, and some build tools, but standard server-side parsing fails on them. The formatter shows exactly what the parser on the other end will see. If you need to fix it rather than argue about it, click “Fix”: it removes the commas and tells you how many it removed.
It only fixes syntax, and only outside strings: trailing commas, single and “typographic” quotes, unquoted keys, comments, NaN, Infinity, and undefined, an extra comma at the end, and the protective prefix )]}' that some APIs put before a response. Values inside strings are left untouched. Each fix is added to the issues list with the number of occurrences, so you can see exactly what changed. The original text is replaced in the field; you can restore it with the usual undo command in the input field.
Not in the listing, tree, selection, or exports: numbers are reproduced exactly as received, without converting them to double-precision floating-point numbers. A nineteen-digit identifier stays unchanged. All numbers outside the safe integer range are listed separately, with paths showing which field must not be passed to JavaScript as a number. Number comparisons in the schema use regular numbers, so nineteen-digit values are approximate.
Parsing succeeds, both pairs remain in the result, and the issues list includes the path to each duplicate, such as $.items[3].id rather than just “id”. The standard does not define the behavior for duplicates: one parser takes the first value, another the last. A duplicate is therefore almost always a data-generation error.
Pasted text, opened files, the schema, and the reference are parsed in the browser and sent nowhere. The only exception is the “Load” button next to the address field: it sends a request to the address you specify. The draft and settings are stored in this browser’s localStorage; the “Reset” button deletes them. The result link does not make any requests either: the document is compressed and placed in the URL hash, and the hash is not sent to the server.
The browser does not let a page read a response from another server unless that server allows it with the Access-Control-Allow-Origin header. Public APIs usually set it; internal ones almost never do. When the browser blocks the response, the tool tries the same request through our server, and honestly reports it if that action has not been enabled there yet. The reliable workaround is to save the response as a file and open the file.
The limit is 10 MB. Parsing runs in a separate thread, so the tab does not freeze, and the bar below the buttons shows how much has been read. The listing shows only the beginning of the result, not the whole thing: no browser will render half a million lines. Use the “Copy” and “Download file” buttons to get the complete result.
In a JSON Lines file, each line contains a separate document, with no commas or shared brackets between them. This is how logs and exports are written: you can append to the file and read it line by line without keeping the whole file in memory. In this mode, the formatter parses each line separately and reports the number of the line that failed. For the tree, selection, schema, and exports, records are collected into one array, so a log can be turned into CSV immediately.
CSV is a flat table, while JSON is a tree. You can turn a tree into a table only when the root (or the JSON Lines records) is an array of objects. In that case, the columns are the union of the keys, and the rows are the objects. Nested objects and arrays are placed in a cell as JSON: this is more honest than losing them or expanding them into a hundred columns.
Creates passwords of the required length and assesses how difficult they are to crack.
Open