JSON Formatter & Validator
Paste JSON to pretty-print it, minify it, or validate its syntax. Strict JSON only (no comments, trailing commas, or JSON5). Formatting preserves your original tokens — large numbers, string escapes, key order, and duplicate keys are kept intact. Your JSON is processed locally in your browser and is not sent to PocketSpry’s AI API.
How the JSON Formatter & Validator works
Paste strict JSON, choose Format, Minify, or Validate only, and process it. Everything runs locally in your browser — your JSON is not uploaded to a server or sent to PocketSpry’s AI API. Format pretty-prints with 2- or 4-space indentation, Minify strips insignificant whitespace, and Validate only checks the syntax without changing your text.
Format JSON without changing your data
The formatter adjusts only the structural whitespace between tokens while preserving the source token content — so large integer and exponent spellings, string escapes and their whitespace, the original key order, and even duplicate keys are all kept exactly as you entered them. It does not reserialize your values through JavaScript, so a number like 9007199254740993 stays exactly that. This is a syntactic transformation, not a semantic conversion.
What counts as valid JSON?
This tool follows strict JSON: double-quoted strings and property names, no comments, no trailing commas, and the standard values (objects, arrays, strings, numbers, true, false, null). Any valid JSON value is accepted, including a top-level string, number, boolean, or null. JSON5, JSONC, single quotes, and unquoted keys are not supported, and the tool does not repair invalid JSON.
Frequently asked questions
- What is the difference between Format and Minify?
- Format pretty-prints JSON with indentation for readability; Minify removes insignificant whitespace to make it as compact as possible. Both preserve your data’s tokens.
- What does Validate only do?
- It checks whether the input is syntactically valid JSON and reports the first error location if not, without returning reformatted text.
- Does this support JSON5 or JSONC?
- No. It is strict JSON only.
- Can JSON contain comments?
- Not in strict JSON. Comments make the input invalid.
- Are trailing commas allowed?
- No. A trailing comma makes the JSON invalid.
- Can the top level be a string or number?
- Yes. Any valid JSON value is accepted, including a top-level string, number, boolean, or null.
- Does this validate against a JSON Schema?
- No. It validates JSON syntax only, not schema or application correctness.
- Does this repair broken JSON?
- No. Invalid JSON stays invalid, with an error you can use to fix it.
- Does formatting sort my keys?
- No. The original key order is preserved.
- Does formatting change large numbers?
- No. Output preserves the numeric token you entered, because it is not reserialized from a JavaScript number.
- Does PocketSpry send my JSON to a server?
- No. This formatter and validator run entirely in your browser.