A structured, modern alternative to plain text files for storing and transferring complex data. Not examinable in the practical exam.
Example
{ "name": "Ana", "grade": 11, "subjects": ["Maths", "IT", "English"] }
Purpose and function: JSON is widely used for transferring structured data between systems (e.g. a web app and a server/API) because its format naturally maps to objects, arrays, and nested structures in most modern programming languages.
| Format | Structure | Best for | Limitation |
|---|---|---|---|
| Text file | Simple, flat lines of delimited data | Very simple data, quick to implement | Awkward for deeply nested/complex data; no built-in querying |
| JSON file | Structured, nested key-value data | Complex/nested data, exchanging data between systems | Still just a file — no built-in multi-user access control or complex querying like a database |
| Database | Structured tables with relationships and a query language (SQL) | Large-scale, multi-user, relational data needing complex queries | More setup/overhead than a simple file for small, one-off tasks |
💡 Exam Tip
If asked to justify choosing JSON over a plain text file, the strongest point is that JSON's nested structure naturally represents complex/hierarchical data (like an object with an array field) far more cleanly than a flat delimited text line.