Format, validate, minify and repair JSON with the error pinned to its line and column, a browsable tree, JSONPath queries, and warnings for duplicate keys and big numbers. All in your browser.
The error pinned to its line and column, and the fix shown item by item.
JSON is defined by RFC 8259 (December 2017, STD 90) and ECMA-404. The grammar is small and strict: strings always in double quotes, no comments, no comma after the last item, numbers with no plus sign and no leading zero, and no NaN or Infinity. That is why an object copied from the JavaScript console, a Python dict (single quotes, True, False, None) or a config file with comments is almost never valid JSON, and JSON.parse only says 'Unexpected token' without showing where. Here a purpose-built parser reads the whole text, does not stop at the first error and lists them all, each with line, column and a plain explanation: trailing comma, single quotes, unquoted key, comment, missing comma, unclosed bracket (pointing at the bracket that opened it), invalid escape, control character inside a string, BOM and invisible Unicode spaces. Repair mode uses the same reading to fix what has an obvious fix and lists every change, instead of rewriting your text blindly. Two problems slip silently through JSON.parse and are flagged here. The first is the duplicate key: RFC 8259 says the behavior is unpredictable, and JavaScript keeps only the last one. The second is big numbers: JavaScript reads every number as a 64-bit double, so integers above 9007199254740991 (2^53 - 1) lose digits; 9007199254740993 becomes 9007199254740992. 64-bit ids, such as Twitter/X and Discord ones, fall in that case, and the output here preserves the original digits instead of rounding. Besides formatting with 2 spaces, 4 spaces or a tab and minifying, the tool sorts keys recursively and stably (by UTF-16 code unit, so uppercase comes before lowercase), shows a browsable tree with each node's path as JSONPath and as a JavaScript accessor, queries the document with a JSONPath subset, escapes and unescapes strings, opens JSON stored inside strings and validates JSON Lines files line by line. Per the RFC, JSON objects are unordered, so sorting keys does not change the document's meaning; arrays keep their order.
How to use
Paste, check the status, pick the output.
Paste the JSON into the input or open a file (.json, .jsonl, .txt, up to 10 MB). The status tells you at once whether it is valid; if not, you get the line, the column and a snippet of the error.
Pick Format (2 spaces, 4 spaces or tab) or Minify, and sort the keys if you like. If the JSON is broken, tap Repair automatically, review the list of changes and use Apply to editor.
Use the Tree tab to browse and copy the path of any node, Query to extract values with JSONPath and Escape to escape or unescape strings. Copy or download the result.
Embed
Use this tool on your site
Paste the code into your HTML and the tool shows up on your page, without J-Kit's navigation and ads. It still runs in the browser of whoever visits your site.
<iframesrc="https://jkit.tools/embed/en-US/json-formatter"width="100%"height="600"style="border:0"loading="lazy"referrerpolicy="no-referrer-when-downgrade"title="JSON Formatter and Validator"></iframe><p style="font-size:12px;margin:6px 0 0">Tool by <a href="https://jkit.tools/en/tools/json-formatter">J-Kit</a></p>
Cite
Cite or link to this tool
Using it in a paper, class or post? Copy the link or a ready-made reference. The access date is today's.
<a href="https://jkit.tools/en/tools/json-formatter">JSON Formatter and Validator</a>
References
Sources and references for this tool
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
The most common causes are a comma after the last item, single quotes, an unquoted key, a comment, and a missing comma between two values. JSON.parse reports only the first problem and, in some browsers, only a character position. This formatter lists every error in the text, each with line and column, shows the snippet with an arrow under the exact spot, marks the line in the editor margin, and has a Go to the error button that selects the spot.