Local JSON tool

JSON Pretty Print

Pretty print turns one JSON value into a readable reprint: a line for each key, two spaces for each level, and the same key order as the text you pasted. This page starts on that reprint.

Result

Runs in your browser. JSON is not uploaded. Privacy policy

A reprint you can hand to someone

Pretty print is the form you paste into a review, a runbook, or a chat when a one-line payload would be unreadable. It is not a new dialect. The result is still JSON, so it parses again. Beautify on this page and Beautify in the extension are the same call: JSON.stringify with an indent of 2. Running it twice produces the same text as running it once, which is what you want if the pretty-printed copy is about to be stored next to the original.

The input box keeps the paste you started with, including awkward spacing. The result box shows the reprint. Copy takes the reprint. If a later step needs the exact server body, use the input, not the result. Pretty print is allowed to change whitespace outside strings. It is not allowed to change key order or to drop a null.

What pretty print will not do

It will not sort keys alphabetically. Two objects that differ only by key order stay different on the page, because they were different in the text. It will not accept comments, trailing commas, or single quotes in order to be helpful. Those are not JSON, and a pretty printer that repairs them hides the bug you were trying to see. The JSON validator shows the line and column. Fix the text, then print it.

It will not turn a stream of newline-delimited JSON into one document. Each line can be printed on its own. It will not pretty-print an empty box into {}. Empty stays empty so you do not copy a fake object into a ticket.

Pretty print, beautify, and minify

Pretty print and the JSON beautifier produce the same two-space text. The beautifier page talks about cleaning a payload before a review. This page talks about the readable copy itself. The JSON minifier is the one-line inverse: use it when the destination cannot keep the line breaks you just added. The JSON formatter is the general paste box if you are still choosing an action.

For a document you will explore rather than paste, switch to Tree view or open the JSON tree viewer. The tree is easier to search. Pretty print is easier to attach to an email. Both come from the same parse, in the browser, with no upload.

Print, then check the edges

  • Long strings stay on their line and wrap only in the display. The copied text keeps them as JSON strings.
  • A string that contains a newline is escaped in the reprint, which is correct JSON. The tree shows the characters; the pretty print shows the escapes.
  • Numbers are reprinted in JSON form. You do not get extra trailing zeroes that were not in the value.
  • After you copy, paste the result into the validator if the destination is strict. A second parse is a cheap confirmation.

Questions

Is pretty print different from beautify?

On this site they are the same two-space reprint. The pages start on that action and explain different jobs: a readable copy here, a cleanup step on the beautifier page.

Why are non-ASCII characters not escaped?

JSON.stringify leaves ordinary non-ASCII characters as themselves. The reprint is valid JSON either way. Characters that must be escaped, such as quotes and control characters, are escaped.

Can I pretty print a file I did not paste?

Open file or drop the file on the input. It is read locally. The result is the reprint, and the original text remains in the input.

Does the page keep my JSON after I leave?

The text lives in the tab while the tab is open. It is not uploaded. The home page remembers only the last action name, such as Beautify, in local storage. It does not remember the payload.