JSON Pretty Printer Online

Beautify compact or minified JSON with clear indentation and line breaks. Your data is formatted in this browser and stays on your device.

Input JSON

Pretty-printed output

Your formatted JSON will appear here.

Paste JSON or open a file to begin.

Make JSON easier to read with a pretty printer

Compact JSON is useful for storage and transfer, but it can be difficult to inspect when everything is on one line. A JSON pretty printer adds indentation and line breaks so you can follow objects, arrays, and nested values. Use this tool to review an API response, check a configuration file, or make a JSON example easier to share.

Paste JSON or open a .json file, choose two spaces, four spaces, or tabs, then select Pretty Print JSON. Copy the result or download it as a file. The tool runs in your browser and accepts input up to 50 MiB.

Example: compact JSON and pretty-printed JSON

This compact object is valid JSON, but its nested fields are harder to scan:

{"user":{"name":"Mina","active":true},"roles":["editor","reviewer"]}

Pretty printing makes the structure visible:

{
  "user": {
    "name": "Mina",
    "active": true
  },
  "roles": [
    "editor",
    "reviewer"
  ]
}

The added spaces and line breaks show which values belong to each object or array. They make the text easier to inspect, but they are not data fields.

How to pretty print JSON

  1. Paste JSON into the input area, or choose Open file to load a local JSON file.
  2. Select two spaces, four spaces, or tabs for indentation.
  3. Choose Pretty Print JSON. The tool parses the input and displays the formatted result.
  4. Use Copy or Download .json to take the result with you.

Changing the indentation setting reformats the current input. You can also press Ctrl + Enter on Windows or Linux, or ⌘ + Enter on macOS, while the input box is focused.

Pretty printing does not repair invalid JSON

A pretty printer must be able to parse the input before it can format it. If the tool reports an error, check the location and correct the syntax first. Common causes include a missing comma or quote, a trailing comma, single quotes around a string, or a closing brace or bracket in the wrong place. JSON strings and object keys use double quotes.

For help locating a syntax problem, try the JSON Validator. If you want a tool that can suggest fixes for common mistakes, use the JSON Repair Tool.

What changes when JSON is pretty printed?

This tool parses the text with the browser’s JSON support and serializes it again with your chosen indentation. That changes whitespace and may normalize how the text is represented; it is not a byte-for-byte preservation of the original file. JSON object key order is generally not meaningful to applications, so do not use pretty printing as a way to preserve a particular source layout.

One practical edge case is numeric precision: JavaScript cannot represent every very large integer exactly. If your JSON contains long numeric IDs or high-precision numbers, check those values in the output before using it. If exact digits matter, keep them as quoted strings in the source data or use a parser designed for arbitrary-precision numbers.

Pretty printer or JSON formatter?

“Pretty print” and “format” both mean adding readable whitespace to valid JSON. This page provides a focused workflow for choosing indentation, copying the result, or downloading it. The JSON Formatter offers additional ways to work with JSON, including tree inspection and related formatting tools.

Frequently asked questions

Does pretty printing change the values in my JSON?

For ordinary strings, booleans, null values, arrays, and objects, it changes the layout rather than the intended data. Because the browser parses and serializes the input, the output text can be normalized. Check large or high-precision numbers carefully because JavaScript may not represent every number exactly.

Can I pretty print minified JSON?

Yes. Paste valid minified JSON and select Pretty Print JSON to add line breaks and indentation.

Why did the tool show a parsing error?

The input is not valid JSON yet, so it cannot be formatted. Check for double-quoted strings and keys, missing commas, trailing commas, and matching braces and brackets.

Is my JSON uploaded?

No. This page uses your browser to read, parse, and format the input. The code does not send the JSON to a server. As with any browser tool, avoid pasting data into a page if you do not trust its source.

How large a JSON file can I open?

The current input limit is 50 MiB. Very large files may still take longer to parse or use more memory depending on your browser and device.