Tools

Free JSON Pretty Print with Sorting and Tree View

Paste a minified API response and read it properly: choose your indentation, sort the keys alphabetically so two payloads can be compared, and fold deep objects away in the tree view. Everything runs in your browser.

Your JSON stays on this page: it is parsed and rendered by your browser, never uploaded, stored or logged.

What Pretty Printing JSON Means

Pretty printing re-renders JSON with line breaks and indentation so its structure becomes visible. APIs send the compact form — one line, no spaces — because it is smaller on the wire, but that form is impossible to read once a payload passes a few hundred characters. Pretty printing changes only the whitespace between tokens: keys, values, types and ordering all survive unchanged, so the output can be pasted straight back into a request.

How to Pretty Print JSON Online

Paste, choose how you want it laid out, read:

  1. Paste the JSON into the left panel, or load the sample payload.
  2. Choose 2 spaces, 4 spaces or a tab, and tick key sorting if you want a stable order.
  3. Press Pretty print. Invalid JSON is reported with the parser's message and the position of the problem.
  4. Read the result as text, or switch to the tree view and collapse the branches you do not need.

Pretty Print or Formatter: Which One Do You Need?

Both pages take the same input and neither uploads anything. They differ in what they are built to do with it:

This page — reading a payload

Indentation control, alphabetical key sorting and a collapsible tree with node, depth and size counts. Built for making sense of an API response you have just captured.

The JSON formatter — editing a document

A full editor with syntax highlighting, inline error markers and minification, for working on a JSON file rather than inspecting one.

Tips for Reading Large JSON Payloads

  1. Sort the keys alphabetically before comparing two responses — diff noise from key ordering disappears.
  2. Use the tree view for deeply nested data and collapse whole branches instead of scrolling past them.
  3. Two spaces keeps deep structures on screen; four spaces reads better for shallow configuration files.
  4. The node, depth and byte counts tell you quickly whether a response grew unexpectedly.
  5. If parsing fails, look for a trailing comma, a single quote, or an unescaped newline inside a string — those three cause most errors.

Frequently Asked Questions

The JSON formatter is a full editor with syntax highlighting, inline error markers and minification, for working on a JSON document. This page is for reading one: indentation, alphabetical key sorting and a collapsible tree view with node, depth and byte counts. Use whichever matches what you are doing — both are free.

No. It is parsed by your browser's own JSON parser and rendered on the page. Nothing is uploaded, stored or logged, so pasting a response that contains customer data or tokens does not send it to us.

No. Only whitespace between tokens changes. Keys, values, types and array order are preserved, and the output parses to exactly the same object. Key sorting is the one option that reorders anything, and it is off unless you turn it on.

Because JSON object key order is not meaningful, but a diff tool treats it as if it were. Sorting both payloads first makes a comparison show only the values that actually differ.

Yes. Payloads of a few megabytes pretty print in well under a second. The tree view renders every node, so on very large documents the plain text view stays the faster of the two.

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, and an unescaped newline inside a string. The error message shows the position where the parser gave up, which is usually one character after the real mistake.