JSON: JavaScript Object Notation: a simple text format for structured data, written as key-value pairs. Most web APIs send and receive data as JSON.
Example
An API returns a user as JSON: { "name": "Asha", "role": "Intern", "skills": ["Java", "SQL"], "active": true }. Your frontend reads the name and shows "Welcome, Asha".
JSON Syntax in a Minute
- Objects are wrapped in curly braces and hold key-value pairs: { "key": value }.
- Arrays are wrapped in square brackets: [1, 2, 3].
- Values can be strings (in double quotes), numbers, true, false, null, objects, or arrays.
- Keys must be in double quotes.
- No comments and no trailing commas are allowed in standard JSON.
JSON vs XML
| JSON | XML | |
|---|---|---|
| Looks like | Keys and values in braces | Opening and closing tags |
| Size | Shorter | More verbose |
| Common in | Modern web and mobile APIs | Older enterprise systems, configuration, SOAP services |
Where You Will Use JSON
In REST API requests and responses, configuration files, NoSQL databases such as MongoDB, and logs. Most languages have built-in or standard libraries to convert objects to JSON and back. A common beginner bug is a missing comma or a single quote instead of a double quote; an online JSON validator finds these quickly.
Related terms
- API: most APIs exchange data as JSON.
- REST API: usually sends JSON responses.
- NoSQL: some NoSQL databases store JSON-like documents.
- HTTP: carries JSON in request and response bodies.
Previous term: Joining Date | Next term: Kanban
Related guides
- Frontend vs Backend: Which Is Better for an Internship?
- Technical Interview Questions for Freshers
- Python Interview Questions Test
Frequently asked questions
What is JSON used for?
JSON is used to store and exchange structured data, especially between web and mobile apps and their APIs.
Is JSON a programming language?
No. JSON is a data format. It is based on JavaScript syntax but is used with almost every language.
What is the difference between JSON and XML?
JSON uses keys and values in braces and is shorter. XML uses tags and is more verbose. Modern APIs mostly use JSON.
Why is my JSON invalid?
Common causes are a missing or extra comma, single quotes instead of double quotes, or unquoted keys.
Explore more internship terms
The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.
Browse all 199 terms