Skip to content
DevKOM

JSON Formatter

Paste JSON to pretty-print it with the indentation you prefer, or switch to compact output. Formatting works on the original text, so large numbers and key order are kept exactly as written.

Indentation
Paste JSON, open a file or load the sample.
Formatted output

How to format JSON

  1. Paste or type your JSON into the input editor, or load the sample.
  2. Choose an indentation: 2 spaces, 4 spaces or tabs, or switch to Minify.
  3. Fix any error shown below the input. The message includes the line and column.
  4. Copy the formatted result or download it as a .json file.

Frequently asked questions

Does the formatter change my numbers or key order?

No. DevKOM re-indents the JSON token by token instead of parsing and re-serialising it, so large integers such as 12345678901234567890, duplicate keys and key order stay exactly as you wrote them. Only the optional Sort keys mode parses the data.

How large a JSON file can I format?

Several megabytes format in well under a second on a typical laptop. The practical limit is your device's memory; very large files (50 MB and up) may make the editor sluggish.

Is my JSON sent to a server?

No. Parsing and formatting happen in JavaScript on your device. DevKOM has no backend that could receive it.

More in Code & Data.