JSON Is a Data Format, Not a Paragraph
Objects, arrays, strings, and null are the whole language. Why one long line is still valid JSON, and what formatting does and does not change.
JSON is a text format for structured data: objects in braces, lists in brackets, and values that are strings, numbers, true, false, or null. APIs often send it as one line so it travels in less space. That line is hard to read and harder to debug.
Format it before you edit it
Paste the payload into the JSON beautifier. If the text is valid JSON, the tool indents it and can show it as a tree you can collapse. If a comma, quote, or bracket is wrong, you get the parser error instead of a pretty print. Fix the source and format again. Formatting does not rename keys or drop fields.
What to check in the tree
- Objects versus arrays. A single record is usually an object. A list of records is an array.
- Null versus a missing key. Null is present and empty. A missing key is not in the object at all.
- Numbers that arrived as strings. "42" and 42 are different types.
Copy the formatted result when you need to share it or store a readable copy. The work stays in the browser. If you are preparing sample text rather than JSON, the text repeater builds repeated lines, and the word counter measures them.
A worked example
This is valid and unreadable: {"name":"Ada","roles":["editor","admin"],"active":true}. After formatting, name, roles, and active sit on their own lines, and the two roles are indented under the list. Nothing in the data changed. Paste that line into the JSON beautifier and collapse roles if you only need to check active. If you remove the comma after "Ada", formatting stops and the error points at the broken spot.
JSON is not a paragraph
Do not run JSON through the word counter to “clean it up.” Case changes and repeated lines will break the quotes and commas. Use the beautifier for structure. Use the placeholder article only when you are inventing sample text, not when you are repairing a payload.
The five values
JSON has objects, arrays, strings, numbers, true, false, and null. An object is a set of named fields. An array is an ordered list. A string is always in quotes, so "42" is text and 42 is a number. Null means the field is present and empty. A missing field is not in the object at all. Formatting does not turn one into the other.
A trailing comma, a single quote, or a comment is enough to make the text invalid. Many editors allow those in their own config files. JSON does not. The beautifier’s job, when the text is broken, is to stop and report the parser error. A pretty print of invalid JSON would be a guess.
Minified is a transport shape
APIs often send one line because spaces are not data. Indentation is for people. Once you can see the tree, collapse the branches you are not checking and leave open the field you are. Copy the formatted text if a teammate has to read it. Do not then run it through a case converter or a repeater. Those tools treat it as prose and will break the quotes.