Developer Tools Runs in your browser Free · no account

JSON Formatter

The JSON formatter indents a JSON document so it can be read, reports the exact line and column of any syntax error, and can sort object keys alphabetically. Everything runs in your browser, so production payloads never leave your machine.

Options
JSON 0 characters
Formatted JSON

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the JSON Formatter

  1. Paste your JSON, or load a .json file from your device.
  2. Pick an indent width, and turn on key sorting if you want a stable order for diffing.
  3. If the JSON is invalid, read the error message — it names the line and column of the problem.
  4. Copy the formatted result or download it.

Example

Input
{"b":2,"a":1}
Output
{
  "a": 1,
  "b": 2
}

Common use cases

  • Making an API response readable while debugging.
  • Normalising two JSON files with sorted keys so a diff shows only real changes.
  • Checking that a hand-edited configuration file is still valid.
  • Preparing a fixture file for a test suite.

Limitations and things to watch for

  • JSON numbers larger than the IEEE-754 double range lose precision, because JavaScript parses them as doubles. Very large integers such as 64-bit IDs should be transported as strings.
  • Comments and trailing commas are not valid JSON and are reported as errors. Formats such as JSON5 or JSONC need a dedicated parser.
  • Key order is preserved unless you enable sorting; duplicate keys keep the last value, matching the JSON specification.

Frequently asked questions

Is my JSON sent to a server?
No. Parsing and formatting run in JavaScript in your browser. Nothing is transmitted or logged, which is why it is safe to paste a production API response.
Why does it reject my JSON with comments?
Comments and trailing commas are not part of the JSON specification. Remove them, or use a parser built for JSON5 or JSONC.
What does sorting keys do?
It reorders object keys alphabetically at every level. That makes two versions of the same document directly comparable in a diff, since key order otherwise varies between serialisers.
Can it handle very large files?
Files of several megabytes format fine. Because everything runs locally the only real limit is your device memory.

Share this tool