A five-line debugging workshop
Looks close. Still won’t parse.
This small booking record has an unquoted key, a missing comma, and a trailing comma. Work through the repairs below. A parser usually stops at the first problem, so fixing one error can reveal the next.
These steps change the lesson only. The formatter does not automatically repair your input.
Invalid · Broken snippet
{
name: "Mara",
"seats": 2
"tags": ["workshop",]
}Three small punctuation problems stop this booking from parsing. Start at the top: name needs double quotes.
See the finished result with 2-space indentation
{
"name": "Mara",
"seats": 2,
"tags": [
"workshop"
]
}Format makes nesting easier to follow. Minify removes optional spacing and line breaks; spaces inside strings such as "front row" remain. Use Copy output to take the result back to your editor.
Follow the error, then look just before it
If the message points at "tags", that key may be fine: the missing comma on the previous line is what made it unexpected. Check the character before the reported position as well as the position itself. Line and column are shown when the browser’s error message provides enough information; wording can vary between browsers.
For a longer response, start with Format and two spaces so you can trace each object and array. Pair each opening brace with a closing brace, and each opening bracket with a closing bracket. Keep comments outside the JSON, use double quotes for strings, and escape a quote inside a string as \".
Valid JSON, unexpected result?
“Valid” checks syntax. It does not check whether an API accepts your fields or whether the values are sensible for your application.
"42" versus 42
The first is text; the second is a number. Formatting does not turn one into the other. An API expecting a number may reject the quoted version.
null versus "null"
One is the JSON null value; the other is a four-letter string. Neither is the same as leaving a property out entirely.
A standalone array, string, number, boolean, or null can also be valid JSON. You do not have to wrap every value in an object, although the service receiving it may require one.
Can formatting change more than the spacing?
Yes. This tool parses and serializes with JavaScript, rather than editing whitespace in place. Duplicate object keys keep the last value, number-like keys may be reordered, and numeric spellings such as 1.0 become 1.
Large integers can lose precision. For example, the numeric value 9007199254740993 becomes 9007199254740992 in this tool. If an identifier must stay exact, use a quoted string when your data format allows it. Keep the original when working with precision-sensitive data or signed payloads.
Your JSON is processed on your device. The tool does not upload or save it, so keep a copy before reloading or clearing the input. With very large files, processing time and memory use depend on your browser and device.