Free · no account · nothing uploaded

JSON formatter and beautifier

Paste minified or messy JSON and get it back neatly indented — or squeezed onto one line, or with its keys sorted. Nothing you paste is sent anywhere.

Workspace/json
RUNS LOCALLY

JSON formatter

Say it the way you would say it to a person. Your words are matched to one of 18 tools by readable rules, and the tool runs right here in your browser. No upload, no account.

/ tools⌘K search↑ last message

JSON formatterRuns on this device · nothing uploaded

This tool runs in your browser and needs JavaScript turned on.

How to format JSON

  1. Paste your JSON into the message box, or drop a .json file into “Your files”.
  2. Say “format this json”, “format it with 4 spaces”, “minify it” or “sort the keys”.
  3. Read the formatted JSON and its structure in the answer.
  4. Download the formatted file from Results.

Things you can type: format this json format it with 4 spaces

Three ways to format

Indent with two spaces (the common default) or four, or minify to a single line for a request body or an environment variable. Sorting the keys alphabetically makes two versions of a configuration file easy to compare line by line.

Alongside the formatted text you get its structure: the keys at each level, the type of every value and the length of every array. On a long API response that is usually the fastest way to find the field you were looking for.

When it will not format

Formatting needs valid JSON. When the text does not parse, you get the line and column where the grammar first fails — a trailing comma, a single quote, a missing bracket — found by scanning the text rather than guessing from the browser’s error message.

For checking rather than formatting, the JSON validator explains the four faults behind most broken files.

This page runs the JSON validator, set up for one job. Open that page for everything it can do.

Questions

JSON formatter: common questions

How do I minify JSON?

Say “minify it”, or choose an indent of 0 in the settings form. The output is the same data on one line.

Does formatting change my data?

No. Only whitespace changes, and the key order changes only if you ask for sorted keys.

Is my JSON sent to a server?

No. It is parsed and formatted in your browser tab.