Local JSON tool
JSON Formatter
A JSON formatter reprints one value so each key can sit on its own line. Paste a payload, drop a .json file, or load the example. Beautify is already selected on this page.
Runs in your browser. JSON is not uploaded. Privacy policy
What the formatter changes
Beautify calls the same reprint the extension uses: JSON.stringify with two spaces. Insignificant whitespace is replaced. Key order follows the text you pasted, so a payload that listed "b" before "a" still lists "b" first. That matters when you diff a fixture against a server response. A formatter that sorts keys hides a reorder that the API actually made.
Strings stay JSON strings. An http or https address is not rewritten here; the JSON tree viewer is what turns those addresses into links. Numbers, true, false, and null stay the types they parsed as. A leading byte-order mark, the character some editors insert at the start of a file, is ignored before parsing so the rest of the file can still format.
The formatter accepts one JSON value, the same rule a response body uses. Two objects back to back, or a stream of newline-delimited rows, is not one value. Split those rows and format them one at a time. The box will not invent a wrapper array for you.
When formatting helps
API payloads, exported settings, and fixture files arrive as a single line or as a messy paste from a ticket. Formatting is the step that makes bracket matching a visual task instead of a counting task. Do it before you review, and use JSON minify only after the shape looks right. Minify is the opposite reprint: one line, for a field that cannot hold newlines.
If you need to read structure rather than produce text, switch to Tree view or open the JSON viewer. Folding an array of a few hundred objects is faster than scrolling a pretty-printed document. Search on that tree matches keys and leaf values without sending the query anywhere.
What it will not guess
A trailing comma, a comment, a single-quoted string, or an unquoted key is invalid JSON. The status line names the line and column from the parser position instead of silently repairing the text. Look at the character just before that column. A missing comma usually sits there. The JSON validator is the same parse with no reprint, plus a short excerpt of the surrounding lines.
Empty input is empty, not a crash and not a syntax error. Paste a value, then format again. On the home page the last action you picked is remembered in this browser and applied to the next paste. This page always starts on Beautify so the heading and the button agree.
Formatter, beautifier, and pretty print
Those three names describe one reprint. Use the JSON beautifier when you are cleaning indentation before a review, and JSON pretty print when you want a readable copy to paste into a document. This page is the general paste box: format, then copy. Copy from Beautify places that two-space text on the clipboard. The original paste remains in the input so you can compare it with the result.
- One JSON value per run
- Two spaces per nesting level
- Key order preserved
- Line and column when the text is not JSON
- No upload: parsing stays in the tab
Questions
Does the JSON formatter upload what I paste?
No. Parsing, the reprint, search, and copy run in the page. Dropping a file reads it on the device. The privacy policy describes the same limit for the extension.
Why two spaces, not four or a tab?
The extension and this page both use two spaces, which is the indent JSON.stringify applies when you pass 2. Tabs are not used. If a house style wants a different width, the tree is a better way to read the document than fighting the indent.
Will it sort my keys?
No. Order follows the parsed text. Sorting would make two equivalent objects look identical even when the server changed the order, and that is a bad default for fixtures.
Can I format JSON5 or a file with comments?
No. Comments and trailing commas fail validation on purpose. The status line points at the line and column. Repair the text, or keep the looser file in the tool that produced it.