Private JSON formatter and validator
Validate, format or minify JSON locally while preserving original number spelling, string escapes and duplicate keys. No text uploads.
Validated JSON
Original number tokens, duplicate keys and string escapes are preserved.
Inputs are processed in this tab. No text, paths or results are sent to our server or saved in an account. Privacy details.
From input to a useful answer.
- 01
Paste JSON and choose indentation or minification.
- 02
Review syntax errors, depth and the resulting layout.
- 03
Copy the result while keeping the original for comparison.
Change layout while preserving tokens
The formatter validates JSON syntax, then writes the original tokens rather than serialising a parsed object. It does not build the output with JSON.stringify. Number spelling, string escapes, property order and duplicate property names remain as supplied, with surrounding layout changed.
This matters for long identifiers: turning a large integer into a JavaScript Number can round it, while this formatter retains its original digits. The next application may still use limited-precision numbers, so preservation here does not guarantee its parsing result.
Inspect deliberate edge cases
The example includes a large integer, a number with two decimal places and a repeated id key. Formatting keeps them visible. Minification removes optional whitespace while retaining those tokens. The tool does not sort keys, resolve duplicates or choose which id the document means.
RFC 8259 recommends unique object names for interoperability. Different consumers handle duplicates differently, so retaining them helps inspection without endorsing the design. Likewise, 1.00 and 1 can be numerically equivalent while their original spellings remain distinct.
Validation has a limited purpose
Comments, trailing commas, unquoted property names and single-quoted strings are rejected. Syntax validation does not check an application schema, prove that a configuration is appropriate or confirm server acceptance. Use the receiving system’s validation for those questions.
Limits are 200,000 input characters, one through eight indentation spaces and 80 container nesting levels. Output is capped at two million characters. Minification can reduce expanded layout, but does not remove input or depth limits, compress files or produce canonical JSON for digital signatures.
References
RFC 8259 — JSON syntax and interoperability ↗MDN — JSON.parse ↗A few useful answers
Will a long integer be rewritten or rounded?
The output preserves its original numeric token. A later consumer may still round it when using a limited-precision number type.
Does it remove duplicate keys?
No. It retains their order and values. You must decide how to repair them for the intended consumer.
Does valid JSON mean valid configuration?
No. A document can pass syntax validation while violating an application schema or expected values.