JSON Formatter
Format, minify and validate JSON, and find syntax errors fast. Everything happens on your device.
Your JSON is processed in your browser and is not uploaded.Paste or open JSON, choose an indentation, then select Format, Minify or Validate. Your result appears below the buttons.
0 characters, 0 B. Up to 5.0 MB, nested up to 200 levels.
Advanced settings and JSON inspection
Advanced large-file text preview
Read a UTF-8 file up to50MiB in bounded sections without loading it into the regular5MiB editor. Sections can split a JSON value or line; this does not validate JSON or format the complete file.
How to use JSON Formatter
Paste or open JSON, choose two spaces, four spaces or tabs, then select Format, Minify or Validate. The default route checks strict JSON and keeps numbers, string escapes and key order as written. Use Show error position to return to a syntax issue. Clear offers Undo until you edit.
Open Advanced settings and JSON inspection, enable advanced processing and choose Strict JSON, JSONC or JSON Lines. The existing action buttons then use that mode. JSONC Format keeps comments; Minify explicitly removes them and exports strict JSON. Trailing commas remain invalid. JSON Lines validates one value on every line and formats/minifies one compact value per line; blank records are invalid.
Enable inspection to see value paths and detailed duplicate-key locations. Show the collapsible tree, expand a branch or search pointer text to select a value. Copy its JSON Pointer, focus its source span, or choose it as a subtree. Pointers use ~1 for a slash and ~0 for a tilde. The root pointer is an empty string. Duplicate-key pointers are ambiguous and cannot identify one occurrence; the occurrence buttons can still focus the exact source.
Processing a subtree returns that value separately. For JSON and JSONC, Download updated document also preserves every surrounding source span. Apply updated document changes the editor only when you explicitly choose it and the result fits the regular input limit. JSON Lines subtrees are exported as separate JSON values so the dataset never gains invalid multiline records. Choose which JSON Lines record to inspect; pointers are relative to that record.
Prepare schema handoff downloads strict data for the existing JSON Schema Test Bench. Open the bench, provide your own Draft7schema and paste the downloaded data into its data editor. No schema validation happens in this formatter. Duplicate keys, unsafe integers, numbers that would round and data over1MiB block handoff; normal token-preserving formatting can still be used.
Download/import editor preferences to reuse syntax, indentation and display choices without including JSON, filenames, private paths, search text, selected records or handoff data. Invalid imports keep your existing choices. Closing controls keeps settings and results; reset keeps your source.
Advanced large-file text preview is separate from the regular editor. Choose a UTF-8 file up to50MiB, read the first bounded section, then use Read next preview section. Each section shows up to64KiB of text or200line breaks and can split a JSON value. It does not validate or format the complete file, and does not load it into the regular5MiB editor. Cancel keeps the last text snapshot.
Example: inspect a saved response without rounding its number
Paste {"a/b":{"~key":9007199254740993},"amount":1.50}. Choose Format to make it readable while keeping both number tokens. Enable advanced inspection, search for /a~1b/~0key and select the value. Copy that pointer or focus its exact source span.
For a log with {"event":"start"}
{"event":"finish"}, choose JSON Lines and record2to inspect the finish event. Each output record stays on its own line. JSON Lines follows the documented UTF-8, one-value-per-line format.
About JSON, comments and local inspection
JSON represents structured values for apps and websites. Formatting changes layout; it does not sort keys or repair invalid input. The original formatter keeps duplicate entries and warns because many other parsers use only the last one.
Regular processing supports5MiB and200nesting levels, with the original32MiB output-character bound. Advanced inspection adds limits of50,000values,200,000tokens and bounded path metadata. Turn inspection off for larger whole-file formatting. A normal advanced task or preview read has8seconds. Tree previews show up to400visible rows, path search the first200matches and duplicate diagnostics the first500details with the complete count. Stream sections use bounded chunks; unread content is not validated.
JSONC parser license and provenance.
Is my JSON uploaded?
Your JSON is processed locally and is not uploaded or automatically stored. Only files you explicitly download are saved. Reloading clears editor data.
Does formatting change my data?
Strict JSON formatting keeps value tokens and key order. JSONC formatting keeps comments; JSONC minification explicitly removes them. JSON Lines stays one value per line. Selected-subtree updates apply only when you choose them.
What counts as valid JSON?
Strict JSON rejects comments, trailing commas, single quotes, unquoted keys, NaN and Infinity. Explicit JSONC mode allows comments, but still rejects trailing commas. JSON Lines requires one valid JSON value per nonblank record.
What happens with duplicate keys?
Duplicate keys remain present with a warning. Advanced inspection shows first and repeated locations. Duplicate pointers can be ambiguous, and schema handoff rejects duplicates.
What are the limits?
Input up to 5.0 MB and nesting up to 200 levels. Larger whole-file inputs are refused. A separate streamed text preview supports files up to50MiB without claiming full validation or formatting.
Which files can I open?
UTF-8 JSON files, with explicit advanced JSONC or JSON Lines modes. Normal file import removes a leading byte order mark and reports it. Larger-file streaming preview is separate; invalid UTF-8 is rejected.
Stars and feedback
Loading…
What should we improve next?
Help shape the next update to JSON formatter. Tell us what would make it better for you.
Prefer email? feedback@tooltulip.com
Tool reference #071