JSON Formatter
Format messy JSON into readable, indented output, and find out exactly where it is invalid when it will not parse.
Everything runs in your browser — which matters here more than for most tools, because the JSON developers need to inspect is usually an API response containing tokens, keys, or customer records.
Output will appear here…This tool runs entirely in your browser
This tool runs entirely in your browser. The data you paste is processed on your device and never sent to Filorra.
That is not a small detail for developer tools. API responses, tokens, config files, and log excerpts routinely contain credentials and customer data, and pasting them into a server-side tool means disclosing them to a third party.
How to use JSON Formatter
Paste your JSON
Minified, malformed, or already formatted — all are accepted.
Format or validate
Valid JSON is indented and structured. Invalid JSON reports the failure position.
Copy the result
Take the formatted output back to your editor.
Why pasting API responses into online formatters is a real risk
It is worth being blunt about this, because it is one of the most common ways credentials leak in ordinary development work.
The JSON a developer needs to format is rarely synthetic. It is a live API response, and it frequently contains bearer tokens, session identifiers, API keys, internal endpoint URLs, email addresses, and personal data belonging to real users. Pasting that into a formatter that posts it to a server discloses all of it to whoever runs that server — and many such tools log submissions.
Because this formatter runs entirely in your browser and never issues a network request with your data, the disclosure does not happen.
Reading a JSON syntax error
Parsers report the position where parsing became impossible, which is often slightly after the actual mistake. Knowing the common causes makes the error immediately readable.
A trailing comma after the last element is the most frequent, because JavaScript object literals permit it and JSON does not. Single quotes are second — JSON requires double quotes for both keys and string values. Unquoted keys are valid JavaScript but invalid JSON.
Beyond syntax, watch for `NaN`, `Infinity`, and `undefined`, none of which exist in JSON. Comments are not permitted either, which surprises people editing config files. And an unescaped newline or a stray backslash inside a string will break the parse at a position that looks unrelated to the real problem.
JSON is not JavaScript
The formats look alike, and the difference causes a steady trickle of confusion.
JSON is a strict data interchange format. Keys must be double-quoted strings, values are limited to strings, numbers, booleans, null, arrays, and objects, and no comments or trailing commas are allowed. JavaScript object literals are far more permissive.
This matters when copying data out of code into a JSON file, or out of a browser console into a validator. Console output is JavaScript representation, not JSON — it may use single quotes, include functions, or show `undefined`. Use the response body itself rather than a console rendering of it.
When to use JSON Formatter
- Making a minified API response readable while debugging.
- Finding the syntax error in a config file that will not load.
- Checking the structure of a webhook payload.
- Tidying JSON before committing it to a repository.
Common problems
- Valid-looking JSON is rejected.
- Check for a trailing comma after the last element, single quotes instead of double, or unquoted keys. All three are valid JavaScript but invalid JSON.
- The error position does not point at anything wrong.
- Parsers report where parsing failed, which is often just after the real mistake. Look at the preceding lines, especially for an unclosed bracket or quote.
- My comments are causing errors.
- JSON does not support comments. Remove them, or use a format such as JSON5 or YAML if your tooling accepts one.
- A very large file is slow to format.
- Formatting is done in the browser, so multi-megabyte documents take time and memory. Format a representative extract instead.
Frequently asked questions
- Is my JSON sent to a server?
- No. It is parsed entirely in your browser and never transmitted, which makes it safe for responses containing tokens or personal data.
- Why is my JSON invalid when it looks correct?
- Usually a trailing comma, single quotes, or unquoted keys — all permitted in JavaScript but forbidden in JSON.
- Can JSON contain comments?
- No. The specification does not allow them. Strip comments before parsing, or switch to JSON5 or YAML if your tooling supports it.
- Does formatting change my data?
- No. Only whitespace and indentation change. Keys, values, and structure are untouched.
Learn more
Guides and answers that explain how this tool's job actually works.