Enter the required information
Use the fields in the tool above and keep units and formats consistent.
Paste minified JSON and get clean, indented output with 2-space, 4-space or tab options. Read API responses, logs and schema markup without squinting.
API responses and log entries often arrive as one long line. Finding a single field in 3,000 characters of minified data wastes time. A JSON formatter adds line breaks and indentation so the structure becomes visible at a glance.
Paste the raw text, pick an indent size and format it. Nested objects step inwards, arrays list one item per line, and you can trace which bracket closes which block.
Here is a typical compact response from an order API:
{"id":1042,"status":"paid","items":[{"sku":"TS-01","qty":2}],"total":1499}
After formatting with a 2-space indent, the same data reads like this:
{
"id": 1042,
"status": "paid",
"items": [
{ "sku": "TS-01", "qty": 2 }
],
"total": 1499
}
Notice how the items array now shows its object clearly. With ten orders, each would sit on its own lines. You could count them and compare fields in seconds.
The values have not changed. Only whitespace was added, so any program reading the data treats both versions as identical.
Two spaces keep deep nesting compact and are common in JavaScript projects. Four spaces suit Python teams and wide screens. Tabs let each reader set their own width. None of these affects validity, so match your team's style guide.
Sorting keys alphabetically makes two similar objects easy to compare in a diff. JSON objects are unordered by specification, so sorting is safe for data. Some tools still display fields in a fixed order, so keep the original order for documentation samples.
Logs sometimes store JSON inside a string, with a backslash before every quote. A formatter cannot indent this directly, because it is a single string value. Remove the outer quotes and the escaping backslashes first, then format the result. Some tools offer this unescape step as a separate option.
A formatter adds whitespace for people. A minifier strips it for machines, cutting payload size. Format while debugging and minify before shipping config or responses over the network. On the command line, jq . pretty prints a file, and python -m json.tool does the same with no extra install.
If the formatter refuses your input, the text is not valid JSON. Run it through the ToolsMate JSON validator to see the exact line and character causing the problem. Also take care with live tokens or customer data. Remove secrets before pasting into any online JSON formatter.
Use the fields in the tool above and keep units and formats consistent.
Review the result shown in the output area.
Confirm that the result matches your situation before using it for a decision.
JSON is parsed and serialized with consistent indentation.This describes the core logic used by the tool. Check any assumptions that may affect your result.
Use accurate inputs and keep units consistent.
Review the assumptions before using the result for a decision.
Compare important results with an independent or official source.
It takes valid JSON and rewrites it with consistent line breaks and indentation. Keys, values and data types stay exactly the same. The output is easier for people to read, but software parses it identically.
No, formatting only adds or adjusts whitespace between tokens. Whitespace outside strings has no meaning in JSON. A parser returns the same object from the minified and the pretty-printed versions of a document.
A formatter needs valid input before it can rebuild the structure. Trailing commas, single quotes, missing brackets or unquoted keys all stop parsing. Validate the text first, fix the reported error, and then format it again.
Open the file, set the language mode to JSON, then use the Format Document command from the command palette. VS Code respects your editor tab size setting, so adjust that if you prefer two or four spaces.
Neither is technically better, since both produce valid output. Two spaces keep deeply nested data narrower on screen, while four spaces give clearer visual steps. Most teams simply follow the convention already used in their codebase.
Browser-based formatters can slow down on files of many megabytes because the whole document is parsed in memory. For large exports, command-line tools such as jq or a desktop editor usually cope better and keep data local.
Yes, JSON-LD is ordinary JSON, so it formats the same way. Copy only the content between the script tags and format it. Review the properties, then paste it back into your page.
Explore other useful tools across the site.