How to format and debug JSON
JSON is easy for software to exchange and surprisingly easy for humans to break. This guide shows a reliable workflow for reading and fixing it.
Start by formatting, not editing blindly
Compact API responses hide nesting and make missing punctuation difficult to spot. A formatter parses the document first, then writes the same structure with consistent indentation. If parsing fails, fix the syntax error before changing the data.
Common JSON syntax problems
- Property names or string values written with single quotes instead of double quotes.
- A trailing comma after the final object property or array item.
- A missing comma between two values.
- Unescaped quotation marks or control characters inside a string.
- JavaScript values such as undefined, comments, or functions, which JSON does not support.
Formatter vs validator vs minifier
Use a formatter when you need readability. Use a validator when the question is simply whether the text is valid JSON. Use a minifier when the payload is already correct and you want to remove formatting whitespace.
When a table is easier than raw JSON
An array of similarly shaped objects is often easier to inspect as rows and columns. Nested object keys can be flattened into column names, while irregular data should usually stay in a tree view.
Privacy when debugging payloads
API responses can contain tokens, email addresses, identifiers, or customer data. ByteKitly's JSON tools process input in your browser, but you should still avoid exposing secrets on shared devices and remove unnecessary sensitive fields before sharing screenshots.