Skip to content

Developer tool · local processing

Format and validate JSON without rewriting values

Paste JSON, choose indentation and get readable or compact output. A token-based parser preserves the original spelling of numbers, strings and keys instead of round-tripping through JavaScript values.

Input

Your data stays in this browser.

The gray text is an example. Run uses it; selecting the input clears it. Leave it empty to restore the example.

Objects, arrays and top-level primitive values are accepted. · 105 / 200,000

Options

Result

How to format JSON safely

Format a document

  1. Paste the complete JSON text.
  2. Choose two spaces, four spaces, tabs or minified output.
  3. Select Format JSON and fix any reported line and column.
  4. Review duplicate-key warnings before copying the result.

What is preserved

Whitespace is replaced, but string escapes, number lexemes and object key order remain exactly as entered. Large integers such as 9007199254740993 are not converted to JavaScript numbers.

Duplicate object keys remain in the output and are reported with their location. Many downstream parsers keep only one value, so resolve them deliberately.

Validation limits

  • Rejects invalid escapes, control characters, trailing commas, truncated input and invalid JSON number grammar.
  • Does not execute code, fetch URLs, apply remote schemas or provide a general-purpose IDE.

JSON formatter FAQ

Does it change large integers?

No. It rearranges validated tokens and never converts number tokens to floating-point values.

Are duplicate keys deleted?

No. They are preserved and listed as warnings because automatic deletion could change meaning.

Can the root be a string or number?

Yes. Any JSON value is valid at the top level.