How to Format JSON Online in 2026
JSON (JavaScript Object Notation) is the backbone of modern web APIs. But raw JSON from an API response or log file is usually minified into a single unreadable line. Formatting it — also called "pretty-printing" — makes it human-readable instantly.
This guide shows you how to format JSON in seconds using a free online tool, plus common pitfalls and best practices.
Step 1: Copy Your JSON
Grab the raw JSON from your API response, log file, database export, or configuration file. It usually looks something like this:
{"users":[{"id":1,"name":"Alice","email":"[email protected]","roles":["admin","editor"]},{"id":2,"name":"Bob","email":"[email protected]","roles":["viewer"]}],"total":2,"page":1}
Step 2: Paste It Into the Formatter
Open the ToolPry JSON Formatter and paste your JSON into the input panel on the left. The tool validates it in real-time as you paste.
Step 3: Click Format
Hit the "Format" button (or press Ctrl+Enter). Your JSON is instantly formatted with proper indentation:
{
"users": [
{
"id": 1,
"name": "Alice",
"email": "[email protected]",
"roles": ["admin", "editor"]
},
{
"id": 2,
"name": "Bob",
"email": "[email protected]",
"roles": ["viewer"]
}
],
"total": 2,
"page": 1
}
Try the JSON Formatter Now →
Common JSON Errors and How to Fix Them
Trailing Commas
JSON does not allow trailing commas. {"a": 1,} is invalid. Remove the comma after the last property.
Single Quotes
JSON requires double quotes. {'name': 'Alice'} is invalid. Use {"name": "Alice"} instead.
Unquoted Keys
Unlike JavaScript objects, JSON keys must be quoted. {name: "Alice"} is invalid.
Missing Brackets
Every opening { or [ must have a matching closing bracket. The ToolPry formatter highlights exactly where the mismatch occurs.
When to Minify Instead
Formatting adds whitespace, which increases file size. For production APIs, you want minified JSON to reduce bandwidth. The ToolPry JSON tool has a one-click Minify button that strips all unnecessary whitespace.
Privacy and Security
The ToolPry JSON Formatter runs entirely in your browser using JavaScript. Your data is never sent to any server. This makes it safe for formatting sensitive data like API keys, tokens, and personal information.
Other Useful Developer Tools
- Base64 Encoder/Decoder — encode data for APIs and emails
- UUID Generator — create unique identifiers for databases
- Hash Generator — MD5, SHA-256, SHA-512 hashes
- Regex Tester — test regular expressions with live highlighting
- URL Encoder — encode query parameters safely