How-to · JSON

How to pretty print JSON in the browser

JSONPeek2 min read

The short answer

If the JSON is a page, click the JSONPeek icon and press "Format this page". If it's a blob on your clipboard, paste it into the extension's converter with both formats set to JSON — it comes back indented, validated, and never sent anywhere.

  1. 1

    For JSON open in a tab: click the JSONPeek icon and press "Format this page".

  2. 2

    For JSON on your clipboard: open Settings and find the Convert panel.

  3. 3

    Set both the input and the output format to JSON.

  4. 4

    Paste the minified blob — the pretty-printed version appears live, indented two spaces.

  5. 5

    If there's a syntax error, fix it at the reported line and column, then press "Copy result".

Minified JSON is for machines: one line, no whitespace, impossible to eyeball. Pretty printing it is a one-second job — the only real question is where you do it. Pasting production payloads into a random "JSON beautifier" website means shipping your data to someone else's server to have spaces added to it. Chrome can do the whole thing locally, and it handles both places minified JSON shows up.

Case one: the JSON is a page

An API endpoint, a webhook payload URL, a .json file — if it's open in a tab, click the JSONPeek icon and press Format this page. The response renders as an indented, foldable tree with search across keys and values, and a Raw toggle that returns the original bytes untouched. The click grants access to that tab only; the extension installs with access to no sites.

Case two: the JSON is on your clipboard

A blob out of a log line, a terminal, a bug report. Open Settings, find the Convert panel, and set both From and To to JSON. That turns the converter into a pretty printer: paste the minified blob and the output pane fills with the same document, two-space indented, live as you type. Copy result puts it back on your clipboard.

Validation is built in

Pretty printing requires parsing, so you get validation for free. If the input isn't valid JSON — a trailing comma, a stray quote, a truncated payload — you get the exact line and column with the reason, instead of silent garbage. On a formatted page the status bar shows ✓ valid JSON; on a broken one, an error panel points at the offending character and still lets you copy the raw text out.

Your numbers come back intact

The classic trap: pretty printing through JSON.parse and JSON.stringify — which is what a browser console and most online beautifiers do — silently rewrites long integers. An ID like 12345678901234567890 comes back as a different number. JSONPeek uses its own parser that preserves the source digits, so the pretty output is the same document, only readable. Numbers a JavaScript double couldn't hold are flagged in the viewer rather than altered.

Nothing to trust but your own tab

Both paths run entirely inside your browser. The extension makes no network requests, collects no analytics and needs no account — so the answer to "is it safe to paste this here?" is: it never leaves the machine you pasted it on. It's also free, and if the blob eventually needs to become CSV or YAML instead, the same panel does that too.

Pretty print JSON without pasting it anywhere

Format pages in place, pretty print clipboard blobs in the converter — validated, digits intact, and nothing ever sent. Free.

See JSONPeek →