Formatting changes whitespace, not data
JSON formatting, also called pretty printing, adds line breaks and indentation so that objects and arrays are easier to scan. It should not change property names, string values, numbers, booleans, null values, or array order.
For example, this compact JSON is valid but difficult to review:
{"project":"LXB Hub","features":["games","tools"],"public":true}A formatter presents the same data more clearly:
{
"project": "LXB Hub",
"features": [
"games",
"tools"
],
"public": true
}Validate before relying on the output
A formatter normally parses the input before it adds indentation. If parsing fails, the text is not valid JSON and should not be silently rearranged. Property names and strings require double quotes, and a comma cannot appear after the last item in an object or array.
Paste a sample into the local JSON formatter and validator. The tool uses the browser's JSON parser and does not send the input to an API.
A reliable formatting workflow
- Keep a copy of the original text when the source matters.
- Paste the JSON into a formatter that also validates.
- Fix the first reported syntax error, then validate again.
- Review the formatted structure for unexpected nesting or value types.
- Copy the result only after it is marked valid.
Fixing the first error matters because one missing quote or bracket can cause several later tokens to look invalid. Work from the earliest parser message instead of editing every highlighted area at once.
Do not paste secrets into browser tools
Local processing reduces exposure because the data does not need a server round trip. It does not make careless handling safe. Remove API keys, access tokens, passwords, private customer records, and production credentials before using any general-purpose tool.
Choose pretty or compact output deliberately
Pretty JSON is better for debugging, code review, examples, and configuration files that people edit. Compact JSON reduces unnecessary bytes when data is transmitted or embedded. Neither form changes the underlying values. The tradeoff is explained in minified vs pretty JSON.