Prettify vs minify
Prettify JSON
Use this when reading API payloads, debugging nested data, or reviewing files in Git.
Minify JSON
Use this when embedding JSON in compact configs or reducing payload size for transport.
Prettifying changes whitespace, not the meaning of the data. If the structure changes, you are not just formatting anymore.
Common invalid JSON mistakes
- Using single quotes instead of double quotes for keys or string values.
- Leaving trailing commas after the last property or array item.
- Putting comments inside the JSON.
- Forgetting to escape line breaks or quotes inside a string.
If you see JSON parse errors, validate the smallest possible snippet first, then expand outward.
Escaping rules worth remembering
| Meaning | Escape | Example |
|---|---|---|
| Double quote | \" | "name":"A \"quoted\" value" |
| Backslash | \\ | "path":"C:\\temp\\file.txt" |
| New line | \n | "body":"line 1\nline 2" |
| Tab | \t | "indent":"\tvalue" |
Use this guide with the right tool
Related tools