Skip to content
Convertto

JSON Formatter & Validator

Format, validate, repair and analyse JSON — with errors that point at the exact line.

To format JSON, paste it above and it is validated, pretty-printed and analysed instantly. You can then explore it as a collapsible tree, a table of records or a JSONPath query, and malformed input is repaired automatically — trailing commas, comments, single quotes, unquoted keys, Python literals and NDJSON.

Runs in your browser
Layout
Two full editors side by side, auto-syncing — or detach the result and edit it independently
Views
Collapsible tree, formatted source, record table, structure analysis
Repairs
Trailing commas, comments, single and smart quotes, unquoted keys, Python True/False/None, NaN, NDJSON
Query
Live JSONPath filtering and full-text search across keys and values
Errors
Reported with exact line, column and a code frame
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Why does my JSON fail with a trailing comma?

The JSON specification does not allow trailing commas, unlike JavaScript object literals. Leave "Auto-repair" on and this tool strips them for you rather than just refusing, then tells you it did.

Can I paste a JavaScript or Python object?

Yes, with auto-repair on. Unquoted keys, single quotes, comments, True/False/None and NaN are all converted to strict JSON by a tolerant parser rather than a regular expression, so string contents are never mangled. Every change is listed above the result.

How do I filter a large document?

Switch the query bar to JSONPath and enter an expression such as $..price or $.items[?(@.qty > 1)]. Every view — tree, formatted, table — then shows only the matches, so you can narrow a 10 MB payload to the ten fields you care about.

Does the second editor update automatically?

Yes. Auto-sync is on by default, so the result pane re-formats as you type on the left. Turn it off with the lightning toggle and the result detaches into a document of its own that you can edit directly; it then tells you when it has fallen behind the source, and a single click pulls the source back in. The choice is remembered on your device.

My JSON arrived as an escaped string. Can this fix it?

Yes. When the input is a JSON document that has been stringified — everything wrapped in quotes with \" escapes, as logs and database columns often store it — an "Unescape" button appears and unwraps it back to a real document.

Is there a size limit?

Only your device. Parsing, the virtualised tree and every view run in your browser, so nothing is uploaded and no request limits apply. Documents in the tens of megabytes work; the tree renders only the rows on screen.

What does nesting depth tell me?

How many levels deep the structure goes, and the Analysis view shows you the exact deepest path. Deeply nested payloads are harder to query and often signal a data model that would be easier to work with flattened or normalised.

How to use the json formatter & validator

  1. 1Enter or paste your json.
  2. 2Choose the indent.
  3. 3Turn "Sort keys alphabetically" on or off as needed.
  4. 4Turn "Try to repair" on or off as needed.
  5. 5The result appears immediately — copy or download it.

Sources & specifications

Embed this tool

Put the working json formatter & validator on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More data & format tools