JSON Formatter

JSON Formatter instantly turns messy or single-line JSON into readable form and pinpoints errors with line and column. Choose the indent width, sort keys alphabetically, inspect the highlighted result. Your API responses never leave the browser. Collapse and expand it in a tree view, query values with JSONPath, repair broken JSON (single quotes, comments, trailing commas) in one click and escape/unescape text as a JSON string.

Indent
—

How it works

  1. 1Paste JSON into the left pane. An API response, config file or log line, anything goes.
  2. 2Pick the indent (2 or 4 spaces, or tabs); optionally enable “Sort keys” for alphabetical order.
  3. 3Invalid JSON shows the error instantly with line and column, jump straight to the first broken character.
  4. 4Copy the highlighted output or download it as a .json file; check size and depth stats.
  5. 5Use the Tree, JSONPath and Escape tabs; on invalid JSON press the "Repair broken JSON" button.

Frequently asked questions

Can I see the exact position of an error?+

Yes. The parser reports the first error's line and column, find a missing comma, unclosed quote or stray bracket in a second.

Is the data I paste safe?+

Completely. Parsing runs on your device with the browser's built-in JSON engine; responses containing API keys or customer data never leave it.

Does sorting keys corrupt my data?+

No. Sorting only changes the written order of object keys; values and array element order are preserved. Object key order carries no meaning in JSON.

How large a file can it handle?+

Files up to a few hundred MB process fine on a modern device. Performance depends only on your machine, there is no server queue.

Can it minify too?+

Yes, the “Minify” mode strips all whitespace down to a single production-ready line; the savings show up in the stats.

What can I do with JSONPath?+

Pick values from a large JSON with an expression: $.store.book[*].title returns all titles, $..price every price at any depth, $.list[1:3] a slice and $.book[?(@.price > 10)] the items matching a condition.

Embed on your site

Size
480 × 360px
<iframe
  src="https://toolsqube.com/en/code/json-formatter/embed"
  width="480" height="360"
  style="border:0;border-radius:14px"
  title="JSON Formatter · ToolsQube"
  loading="lazy">
</iframe>

Want to go deeper on this topic: Developer Tools Guide →

Command Palette

Search for a command to run…