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
- Paste the JSON string.
- Set indent spaces, then format.
- 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
- JSON ValidatorCheck whether JSON is syntactically valid and see the line and column of the first error. Validation stays in your browser.
- JSON MinifierMinify JSON by stripping extra whitespace to shrink request payloads. Compression of the text happens locally in this tab.
- JSON to CSVConvert a JSON object or array of objects into CSV for spreadsheets. Nested keys flatten with dots, all inside your browser.
- Base64 DecoderDecode Base64 back into readable UTF-8 text so you can inspect tokens and payloads. Decoding never leaves this browser tab.
- URL EncoderPercent-encode query values and path segments with encodeURIComponent. Spaces become %20. Encoding stays in your browser.