Back to Tools

JSON Pretty Print

Transform compressed JSON into a highly readable "Pretty" format

0
JSON Data

Turn a wall of JSON into something you can actually read

APIs, logs and database exports often deliver JSON as one long unbroken line. That is efficient for machines and miserable for people. JSON Pretty Print reformats such text with consistent four-space indentation, puts each property and array item on its own line, and colors the pieces so you can tell keys from values at a glance. It is meant for reading and reviewing, so the output panel is styled like a small code viewer.

How to pretty print a document

  1. Paste your JSON into the JSON Data box. If it is on your clipboard already, the Paste button reads it in for you, provided the browser allows clipboard access.
  2. No data handy? Load Sample JSON inserts a deliberately minified example so you can see the difference.
  3. Click Pretty Print JSON. The page scrolls to the result.
  4. Read the dark output panel. Keys appear in indigo, strings in green, numbers in amber, booleans in pink and null in grey.
  5. Use Copy Result to copy the plain formatted text, or Download to save it as a file called pretty-json.json.

A Bytes counter in the header shows the size of your pasted input, which is handy when you want a rough sense of the payload you are dealing with.

What you can and cannot adjust

There are no indentation or sorting settings here. The tool always uses four spaces and always keeps keys in their original order. That predictability is useful when you are comparing two outputs, because the same input always produces identical text. If you need tabs or two-space indents, you will need to reformat afterward in your editor.

Typical situations

  • Reading an API response copied from browser developer tools or a curl command.
  • Cleaning up a configuration or settings blob before adding it to a repository or ticket.
  • Making a JSON snippet presentable for documentation, a code review comment or a support message.
  • Checking nesting when a value seems to be missing, since the indentation makes structure obvious.

Good to know

  • The text must be strict JSON. Comments, single quotes and trailing commas cause an Invalid JSON dialog that explains the parser error.
  • Formatting runs in your browser through JavaScript, and the copied and downloaded text has no color markup, only clean indented JSON.
  • Colors are added by a simple pattern match on the printed text, so they are for reading only and do not affect the data.
  • Large payloads produce very long output; the panel scrolls, but browsers can slow down on multi-megabyte input.
  • Parsing and reprinting can change number representation slightly, for instance 1.50 becomes 1.5 and huge integers may lose precision.

Related Tools


Frequently Asked Questions

Can I change the indentation size?
No. The tool always indents with four spaces and preserves the original key order. If you need tabs or two spaces, copy the result into an editor that can reindent, or use a formatter that exposes indentation settings.
Does the copied text include the colors?
No. The colors exist only in the on-screen panel. Copy Result and Download both use the plain text version, so what you paste elsewhere is ordinary indented JSON with no markup or styling attached.
What does the Paste button do?
It reads text from your clipboard into the input box using the browser's clipboard API. Browsers may ask for permission first, and it can fail if permission is denied. Pasting with Ctrl+V or Cmd+V into the box works either way.
Why do I see an Invalid JSON message?
The text could not be parsed as strict JSON. Look for single quotes, unquoted keys, comments, trailing commas or unbalanced braces. The dialog includes the parser's own description, which usually points to the position where parsing stopped.
What file name does the download use?
The Download button saves the formatted text as pretty-json.json with a JSON content type. You can rename it afterward. The file contains the same four-space indented JSON that you see in the result panel.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.