JSON validator, beautifier and path finder
Check JSON, fix it with exact error positions, format or minify it, and click any value to get its JSONPath for your API test assertions. Runs in your browser.
Valid JSON (object)
Click any key or value to get its path.
Why a JSON path finder for testers
API assertions need the exact location of a value: body("data.items[0].price", equalTo(499)) in Rest Assured, or pm.expect(pm.response.json().data.items[0].price) in Postman. Counting brackets by hand in a long response is slow and error-prone. Paste the response, click the value, copy the path.
Common JSON errors this tool explains
- Trailing comma:
{"a": 1,}is invalid. Remove the last comma. - Single quotes: keys and strings must use double quotes.
- Unquoted keys:
{a: 1}works in JavaScript but is not JSON. - Comments: JSON has none. Remove them before parsing.
- NaN, Infinity, undefined: not valid JSON. Use
nullor a string. - Missing or extra brackets: the error shows the line and column where parsing gave up, which is usually just after the real mistake.
Related: how to assert on responses in the API testing questions.
Questions
Is my JSON sent to a server?
No. Validation, formatting and path finding all run in your browser. You can use it with API responses that contain real data.
Which JSONPath syntax is supported?
Root $, child .name and ['name'], index [0] and [-1], wildcard *, recursive descent .., unions [0,1], slices [1:3] and [::2], and filters such as [?(@.price < 10 && @.isbn)] with length(). Expressions are parsed, never evaluated as JavaScript.
Why does the validator warn about large numbers?
JavaScript and many JSON libraries store numbers as 64-bit floats, so integers above 9,007,199,254,740,991 are silently rounded. If an id or account number needs every digit, send it as a string.
How do I use the path in Rest Assured or Postman?
Select a value in the tree. The tool shows the path ready to paste: a Rest Assured body() path, a Postman pm.response.json() accessor, a JavaScript accessor, a jq filter and the JSONPath itself.
