Developer tools · free · no signup

JSON Formatter & Validator

Validate, pretty-print, or minify JSON safely in your browser. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use JSON Formatter & Validator

  1. Paste JSON into the input box, drop a .json file on it, press 'Load Sample JSON', or use 'Upload .json'.
  2. Pick 'Format Mode' (2 spaces, 4 spaces, tabs or minified) and tick 'Sort Keys' if you want alphabetical order.
  3. Optionally type a path into 'Filter / JSONPath', such as users[0].name, $.items[*].id, $..price, $.list[0:2] or $.items[?(@.qty > 1)]; results update as you type and the matched paths are listed.
  4. Press 'Format JSON' or 'Minify'. Errors show the line, column and a caret under the problem; big-integer, long-decimal and duplicate-key warnings appear under the buttons.
  5. Tick 'Lenient parse' or press 'Auto-Repair Syntax' for comments, trailing commas, single quotes and unquoted keys; the page lists exactly what it fixed. Use Tree View, 'Export TypeScript', 'Export JSON Schema', 'Export CSV' or 'Download' for the result.

Worked example

Paste {"order":1836049281729482710,"qty":3,"qty":4} and press 'Format JSON'. The output keeps order as 1836049281729482710 and both qty entries, and the warnings name $.order (above 2^53) and $.qty (duplicate key). Type $.order in the filter to see just that value.

When to use this tool

  • Making an API response readable before pasting it into a bug report, without rounding order or snowflake IDs.
  • Cleaning a hand-edited config that has comments, trailing commas and single quotes, with a list of what changed.
  • Pulling a single value out of a large response with a path such as data.items[0].id.

Important limitations

Standard JSON requires strict double quotes around property names and strings. Trailing commas, single quotes, and JavaScript comments are non-standard and flagged with line/column pointers.

Frequently asked questions

Are long IDs rounded?

No. This page parses with its own parser and keeps every number exactly as written, so 9007199254740993 stays 9007199254740993 in the formatted output. Integers above 9007199254740991 and decimals with more than 17 significant digits are listed as warnings, because JavaScript's JSON.parse would silently round them elsewhere. 'Write integers above 2^53 as strings' quotes them for you.

What does the filter box understand?

Dot and bracket paths with an optional $: a.b, users[0].name, users[-1], ['odd key'], [*] and .* wildcards, .. recursive descent, slices like [0:2], comma lists of quoted keys, and one comparison filter such as [?(@.age >= 30)] or [?(@.isbn)]. && and || filters, regex and functions are not supported here; the JSONPath Tester page covers those.

What does Auto-Repair change?

It runs a tolerant parser rather than text patterns, so a // inside a string, such as a web address, is left alone. It removes // /* */ and # comments, trailing commas, single-quoted strings and keys, quotes bare keys and turns Python True, False and None into JSON. Every fix type is listed with the line numbers. If the input is not repairable, you get the line and column of the error.

Does it handle big files?

Inputs over about 800,000 characters are parsed in a background worker so the page stays responsive, and the tree only builds the branches you open (200 children at a time). Your text is never uploaded; the page shows how many requests to other origins it has made.

Are duplicate keys kept?

Yes. Most parsers keep only the last one without telling you. Here every entry is kept in the output and each duplicated path is flagged. Sorting keys is stable for equal keys.

What do the exports produce?

TypeScript interfaces and JSON Schema (draft 2020-12) are inferred from the one sample you pasted, so optional fields and required lists reflect that sample only. CSV flattens nested objects into dotted columns and keeps arrays inside cells as JSON.