JSON Formatter & Beautifier
Format and beautify JSON in your browser with 2-space, 4-space, or tab indentation. Errors reported with line and column. Free, no upload.
About this tool
Pretty-print minified or messy JSON into a readable, consistently indented document. Choose 2-space (default), 4-space, or tab indentation.
Invalid input is rejected with the line and column of the first error, so this doubles as a validator while you clean up a payload.
Common uses
- Make a minified API response readable before debugging it.
- Normalize indentation before committing a JSON file.
- Spot the missing comma in a config file via the precise error location.
Automate via API
The same conversion is available as a REST endpoint for scripts, pipelines, and backends:
curl -X POST https://payloadly.com/api/v1/tools/json-formatter \ -H "Content-Type: text/plain" \ -H "X-Api-Key: YOUR_API_KEY" \ --data-binary @input.json
Worked examples
Real payloads from tools people use daily, with the exact output this converter produces. Every example runs in your browser, so you can load one and adapt it to your own data.
Format a minified API response
API and webhook responses often arrive as one unreadable line; formatting reveals the structure so you can debug it.
{"id":"ch_3PabcXYZ","object":"charge","amount":2000,"currency":"usd","paid":true,"customer":"cus_QabcXYZ","metadata":{"order_id":"1001"}}{
"id": "ch_3PabcXYZ",
"object": "charge",
"amount": 2000,
"currency": "usd",
"paid": true,
"customer": "cus_QabcXYZ",
"metadata": {
"order_id": "1001"
}
}Format a package.json
Paste a minified or messy package.json to get consistent 2-space indentation before committing it.
{"name":"my-app","version":"1.0.0","private":true,"scripts":{"dev":"next dev","build":"next build","test":"vitest run"},"dependencies":{"next":"^15.0.0","react":"^19.0.0"}}{
"name": "my-app",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"test": "vitest run"
},
"dependencies": {
"next": "^15.0.0",
"react": "^19.0.0"
}
}JSON notes
JSON (JavaScript Object Notation) is the standard interchange format for web APIs, config files, and log pipelines. It is strict: keys must be double-quoted, trailing commas are invalid, and comments are not allowed.
- JSON does not support comments; they are stripped or rejected by parsers.
- Trailing commas after the last element are invalid JSON.
- Integers beyond 2^53 lose precision in JavaScript-based parsers.
Frequently asked questions
Is my data uploaded to a server?
No. This tool runs entirely in your browser using JavaScript, and there are no ads on the page. Nothing you paste or drop here is uploaded, logged, or stored, and you can verify that yourself: open your browser's developer tools and watch the Network tab while you convert (no requests leave the page), or disconnect from the internet after the page loads and keep working.
Does formatting change my data?
No. Formatting only changes whitespace. Key order and all values are preserved exactly; the output parses to a document identical to the input.
Is there a size limit or a fee?
The browser tool is free with no signup and comfortably handles files up to tens of megabytes (limited by your device's memory). For automated or bulk processing inside your own scripts and pipelines, use the paid REST API.
Related tools
Minify JSON in your browser: strip all whitespace for smaller payloads and env vars. Shows size savings. Free, private, no upload.
Flatten nested JSON to single-level dot-notation keys in your browser. Ideal for CSV prep, diffing, and key inventories. Free, no upload.
Generate a JSON Schema (draft-07) from sample JSON in your browser. Infers types, required fields, and array item shapes. Free, private.
Convert JSON arrays or objects to CSV in your browser. Flattens nested keys to dot notation, handles quoting per RFC 4180. Free, private, no upload.