Why format JSON at all
JSON is the default for APIs, config files, and browser storage. Minified JSON is efficient on the wire and unreadable on a screen. A formatter adds consistent indentation and line breaks so objects, nested arrays, and long string values are scannable. ToolPin JSON Formatter does that entirely in your browser with the built-in JSON parser. Nothing is uploaded. The tool is free and does not require an account.
This is not a linter for schema (required keys, types). It only asks: is this valid JSON, and can we reprint it with whitespace? For schema checks, use a JSON Schema validator in your project. For smaller files on the wire, use JSON Minify on the same site — the inverse operation, also local.
What “valid JSON” means here
The parser follows standard JSON: double-quoted keys and strings, no trailing commas, no comments, no undefined, no single quotes. JavaScript object literals that work in a .js file often fail here. That is correct. If you need to accept JSONC or JSON5, strip comments in your editor first or use a dedicated JSONC tool.
Numbers stay numbers. Large integers above Number.MAX_SAFE_INTEGER can lose precision in JavaScript. If you are formatting bank IDs or snowflake IDs, treat them as strings in the source JSON. The formatter will not silently convert types; it reprints what the parser accepted.
Unicode in strings is preserved. Escapes like \n stay valid JSON escapes after round-trip in most engines. You do not need to HTML-escape the output unless you are embedding it in a web page.
Errors and how to read them
A parse error usually names a position. Look one token earlier: a missing comma after a value, an extra comma after the last property, or a key without quotes. Copy the snippet around that index into a smaller test. Do not “fix” JSON by adding quotes around the entire blob.
If the input is empty, you get an error, not an empty object. If you paste XML, YAML, or a Python dict, it will fail — convert those formats properly instead of hoping a formatter will guess.
Privacy
Logs and API responses often contain tokens, emails, and PII. Because formatting is local, you can pretty-print production payloads on a locked-down laptop without sending them to an online “JSON viewer” that stores pastes. ToolPin does not keep a history of what you typed.
Very large documents (tens of megabytes) can freeze a tab. Pretty-printing multiplies size with whitespace. For huge files, use jq or a desktop editor. This page is for the everyday payload: a few kilobytes to a couple of megabytes.
After you format
Copy with confidence into git. Set your editor to the same indent (2 spaces is common) so diffs stay small. If you need CSV rows from an array of objects, use JSON to CSV next. If you only needed to shrink the file again, run JSON Minify.
ToolPin is a convenience formatter, not a JSON database. Keep source of truth in your repo.