Skip to content
MaxyTools

JSON Formatter

Help: JSON Formatter

  • Paste single-line JSON or drop a file: it is indented at once, with 2 spaces, 4 spaces or a tab, and keys can be sorted alphabetically at every level.
  • The result shows as coloured code or a collapsible tree: for a big document the tree opens only the useful levels and shows long lists in batches of 100.
  • Nothing is rounded: a 20-digit identifier, 92.50 or 1E5 are copied exactly as you wrote them, whereas most tools rewrite them through a JavaScript number.
  • On error, the tool gives the line, the column, an excerpt with a caret and the likely cause: extra comma, single quotes, unquoted key, comment, NaN…
  • Duplicate keys are flagged and kept. Everything stays in your browser; limit of 25 million characters.

Limits

Accepted formats: JSON

Recommended maximum size: 25 MB

How to use this tool

  1. Paste your JSON or drop a file (“Load an example” to try).
  2. Pick the indentation and key sorting.
  3. Browse the result as code or tree, then copy it or download the file.

Format unreadable JSON: indentation of 2, 4 spaces or tab, sorted keys, colouring, collapsible tree and big integers preserved.

Loading the tool…

How to use this tool

  1. 1

    Paste your JSON or drop a file (“Load an example” to try).

  2. 2

    Pick the indentation and key sorting.

  3. 3

    Browse the result as code or tree, then copy it or download the file.

Help

  • Paste single-line JSON or drop a file: it is indented at once, with 2 spaces, 4 spaces or a tab, and keys can be sorted alphabetically at every level.
  • The result shows as coloured code or a collapsible tree: for a big document the tree opens only the useful levels and shows long lists in batches of 100.
  • Nothing is rounded: a 20-digit identifier, 92.50 or 1E5 are copied exactly as you wrote them, whereas most tools rewrite them through a JavaScript number.
  • On error, the tool gives the line, the column, an excerpt with a caret and the likely cause: extra comma, single quotes, unquoted key, comment, NaN…
  • Duplicate keys are flagged and kept. Everything stays in your browser; limit of 25 million characters.

Related guide : JSON: format, validate, minify and convert to CSV without errors

Frequently asked questions

Is my 19-digit identifier changed?

No. Numbers are copied as written: 9007199254740993 stays 9007199254740993, whereas a plain JSON.parse followed by JSON.stringify would turn it into 9007199254740992.

Why is my JSON rejected when my editor accepts it?

Strict JSON allows no comments, no trailing comma, no single quotes, no unquoted keys, no NaN or undefined. The error shown names the problem and its exact position.

Does sorting keys change the meaning of the JSON?

Not for nearly every use: key order in a JSON object carries no meaning. Sorting helps compare two files or get a stable diff.

· Updated on

Similar tools