Skip to content
PocketCaliper
Language
Open menu

Runs locally in your browser

JSON Formatter

Pretty-print JSON with a chosen indent so API payloads are readable. Formatting runs in your browser and never leaves this tab.

Paste a minified response and expand it with two-space or four-space indent. This page is for readability, not for a pass or fail badge.

Parsing and stringify happen with the JSON APIs in this tab. The payload is not posted anywhere.

How to use

  1. Paste the JSON string.
  2. Set indent spaces, then format.
  3. Copy or download the pretty-printed output.

How it works

Valid input is parsed, then serialized with your indent. Object key order follows what JSON.parse returns in this engine.

If parsing fails, you see the engine message plus line and column when the position can be inferred. Fix the source, then format again.

Examples

  • API response

    A one-line webhook body expands into nested objects you can scan before writing a mapper.

  • Config blob

    A packed package.json paste becomes a two-space tree that matches most JavaScript repos.

FAQ

Does formatting fix invalid JSON?

No. The input must parse first. Use the validator if you only need a syntax check.

Are comments allowed?

No. Standard JSON has no comments. Strip them before formatting.

Will key order change?

Order follows the parser in your browser. Do not rely on a stable sort beyond that.

Is the payload uploaded?

No. Pretty-print stays in this tab.

Related tools