JSON Formatter & Validator
Format, validate, and minify JSON with clear error messages and line numbers.
Formatted JSON appears here.About the JSON Formatter & Validator
This JSON formatter takes raw or minified JSON and turns it into a readable, consistently indented document. Paste anything from a one line API response to a large configuration file and the formatted result appears as you type. If the input is not valid JSON, the tool tells you where parsing failed, with the line and column, so you can fix the exact character that breaks it rather than hunting through the whole document.
Use it when an API returns a wall of unformatted text, when a config file stops parsing after a manual edit, or when you need to shrink JSON before embedding it somewhere size matters. The output mode switches between formatted, with your choice of two spaces, four spaces, or tabs, and minified, which strips all insignificant whitespace.
Common causes of invalid JSON are trailing commas after the last item in an object or array, single quotes instead of double quotes, unquoted keys, and comments. JSON allows none of these, even though JavaScript does. If your data uses them, it is JavaScript object notation, not JSON, and the validator will point at the first offending character.
Everything happens in your browser. The JSON you paste here is never sent to a server, which makes this tool safe for API responses and configuration that contain keys, tokens, or internal data.
Reach developers and designers who use these tools every day. Privacy-first, no trackers.
Frequently asked questions
Is my JSON uploaded to a server?
No. Parsing, validation, and formatting all run in your browser with JavaScript, using the same JSON.parse engine your browser uses for every website. Nothing you paste is transmitted, logged, or stored anywhere: you can confirm this by loading the page, disconnecting from the internet, and formatting a document, which works exactly the same offline. That makes the tool safe for API responses, configuration files, and payloads that contain API keys, session tokens, customer records, or internal URLs. Many online formatters send input to a server to process it, which quietly turns a formatting task into a data disclosure. This one is built so that it cannot, and the same is true of every other toolhq utility except the three network tools that clearly say otherwise on their pages.
Why is my JSON invalid?
The most common reasons are trailing commas after the last item, single quotes instead of double quotes, unquoted property names, and comments. JSON is stricter than JavaScript: every key must be a double quoted string, strings cannot span lines without escaped characters, and no comment syntax exists at all. Data copied out of JavaScript source code fails for exactly these reasons, because object literals allow all of them. Two subtler causes are worth checking when the obvious ones are absent: invisible characters such as smart quotes or non breaking spaces introduced by copying through a chat app or word processor, and values like NaN, Infinity, or undefined, which JavaScript produces but JSON does not accept. The validator reports the line and column where parsing failed, which points at the first offending character rather than leaving you to scan the whole document.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so people can read the structure. Minifying removes all unnecessary whitespace so the JSON is as small as possible, which is useful when embedding it in a URL, a config value, or a payload where size matters.
Can it handle large files?
Yes, within the limits of your browser. Documents in the tens of megabytes typically format in well under a second since everything runs locally. Extremely large files are limited by your device memory rather than any server quota.
Does formatting change my data?
No. Formatting only changes whitespace. Key order and values are preserved exactly as parsed. One thing to note: duplicate keys are collapsed to the last occurrence, because that is how JSON parsing is defined.