Local JSON tool

JSON Beautifier

Beautify rewrites a JSON value so a person can read it. Each key gets a line, and each nesting level gets two spaces. This page starts on that action.

Result

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

The indent is the whole change

A beautifier does not rename keys, convert types, or drop nulls. It parses, and if the parse works it prints the value again with insignificant whitespace normalized. Two spaces is the width this tool uses, matching the extension. There is no tab character in the result. Trailing spaces on a line are not kept, because they were never part of the data.

Key order is data for anyone comparing fixtures. Input that contains "id" before "name" is reprinted with "id" before "name". If you beautify twice, the second run matches the first. That stable reprint is what you want in a pull request: the diff shows real edits, not an indent fight and not an alphabetical sort.

Before you beautify

Check that you have one JSON value. A trailing comma is the most common failure in a hand-edited object. The parser reports the line and column; it does not delete the comma for you. Open the JSON validator if you want the excerpt of nearby lines without a reprint. After the text is valid, beautify, then read it. Use JSON minify later if the destination is a single-line field.

A byte-order mark at the start of a file is stripped before the parse. The rest of the file beautifies normally. The column numbers you see on an error refer to the text after that mark is removed, which is the text the parser saw.

Beautify is not a tree

Indented text is still text. A three-hundred-element array becomes three hundred blocks, and finding one key means scrolling. The JSON viewer draws the same value as a tree with child counts and search. Use beautify when a person or a diff will read the source. Use the tree when you are exploring. JSON pretty print is the same two-space reprint, described for the moment you need a clean copy rather than a cleanup step.

Copy after Beautify puts the indented text on the clipboard. The input is left as you pasted it, so you can beautify again after a small edit. Nothing is stored on a server. The last action you choose is kept in this browser only when you are on the home page; this page always opens on Beautify.

A short review habit

  1. Paste the payload that a ticket or a log already gave you.
  2. Beautify. If the status names a line, fix that line and run it again.
  3. Read the indented result from the outside in: top keys, then one nested object.
  4. Copy the indented form into the review, not the original one-line paste.
  5. Minify only the final body you will send, and only after the shape is right.

Questions

Does beautify change values?

It changes whitespace outside strings. Text inside strings stays the string that parsed, including spaces. Numbers are reprinted with JSON.stringify, so a numeric value round-trips as JSON, not as an arbitrary pretty-printer format.

Can I choose four spaces?

This page uses two spaces so it matches the extension. It does not offer a second indent width. The tree view avoids the question by not using indentation as the way you read depth.

Why did my comments disappear?

They did not disappear; the file never parsed. JSON has no comments. The status line points at the first problem. Remove the comment or the trailing comma, then beautify.

Is the beautified copy uploaded when I press Copy?

Copy writes to the clipboard on the device through the browser clipboard API. This site does not receive the text.