Formats/JSON
What Is a JSON File? The Data Format Behind Apps and APIs
JSON (JavaScript Object Notation) is the format the software world uses to move structured data around. When an app talks to a server, when a website loads your feed, or when you open a program's settings or configuration file, there is a very good chance JSON is involved. Despite the "JavaScript" in the name, it is language-independent and used everywhere — and despite looking intimidating as a dense wall of brackets, its underlying structure is genuinely simple.
What JSON looks like
JSON represents data with a small set of building blocks: objects (collections of named values inside curly braces `{ }`), arrays (ordered lists inside square brackets `[ ]`), and simple values — text in double quotes, numbers, `true`, `false`, and `null` for "nothing". An object pairs a name with a value using a colon, like `"name": "Alex"`, and commas separate entries. A contact might be an object with `"name"`, `"email"` and `"phone"` fields; a list of orders might be an array of such objects.
That really is the whole vocabulary. Any JSON file, however large, is just these few patterns nested inside one another. Once you can see the braces, brackets and commas, the structure becomes readable — the difficulty is almost always that machines store JSON crushed onto a single line to save space.
Why JSON took over from XML
JSON largely displaced the older XML for data exchange because it is lighter and easier for both people and programs to work with. It carries the same structured data with far less punctuation and no closing tags, so the files are smaller and less noisy, and it maps directly onto the data structures programmers already use. For sending data between a browser and a server — the core of nearly every modern web app — it became the default.
XML still has its place for documents with mixed text and markup and for systems built around it, but for pure structured data — settings, API responses, records — JSON is now the near-universal choice. Its readability, once formatted, is a big part of why.
The punctuation rules that trip people up
JSON is strict in ways that are easy to get wrong by hand. Every name and every text value must use double quotes — not single quotes. Commas separate entries but must not trail after the last item in an object or array. Every opening brace or bracket needs a matching close. A single missing comma or stray bracket makes the entire file invalid, and most programs reject it with a vague "parse error" rather than pointing at the problem.
This is why a validator is so useful: it checks the structure and tells you specifically what is wrong and roughly where, turning a frustrating guessing game into a quick fix. It matters most when hand-editing a configuration file or building a request to send to an API, where one tiny slip otherwise costs several rounds of trial and error.
How to read, format and validate JSON
To make a compact, single-line JSON file readable, "beautify" (pretty-print) it: this adds indentation and line breaks that reveal the existing structure without changing the data at all. To ship it again — embed it in a config file or an API request — "minify" it back to compact form. A formatter does both and validates the syntax as you go, flagging errors. OfficePad's JSON formatter runs in your browser, so even sensitive data stays on your device; to compare two versions of a JSON file, a diff checker shows exactly what changed.
Frequently asked questions
How do I open a JSON file?
Any text editor opens JSON since it is plain text, but it is far easier to read in a JSON formatter that pretty-prints it with indentation and highlights any syntax errors.
Why is my JSON invalid?
Usually a small punctuation error — single quotes instead of double, a trailing comma after the last item, or a missing bracket. A validator points out exactly where the problem is.
What is the difference between JSON and XML?
Both carry structured data, but JSON is lighter, has less punctuation and no closing tags, and maps directly onto programming data structures, which is why it became the default for web APIs.
Work with JSON on OfficePad
See also in the glossary: Character encoding, UTF-8, Base64.