What is JSON?
JSON stands for JavaScript Object Notation. It is a lightweight, text-based data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. Despite its name, JSON is language-independent — it is supported natively by Python, Java, PHP, Ruby, C#, Go, and virtually every other programming language.
JSON was derived from JavaScript object syntax and standardized as RFC 8259. It is the standard data format for REST APIs, web applications, configuration files, and NoSQL databases.
JSON Syntax Rules
- Data is represented as key-value pairs
- Keys must be strings enclosed in double quotes
- Values can be string, number, boolean, null, object, or array
- Key-value pairs are separated by commas
- Objects are enclosed in curly braces
{} - Arrays are enclosed in square brackets
[] - No trailing commas are allowed
- No comments are allowed in standard JSON
Common mistake: Single quotes are not valid in JSON. All strings — including keys — must use double quotes.
JSON Data Types
JSON supports exactly six data types:
String
Text in double quotes
"Hello, World!"
Number
Integer or float
42 or 3.14
Boolean
true or false (lowercase)
true
Null
Empty / no value
null
Object
Key-value pairs
{"key": "val"}
Array
Ordered list of values
[1, 2, 3]
JSON Examples
Simple JSON Object
JSON Array of Objects
This is the most common output when converting CSV to JSON:
Nested JSON Object
JSON objects can be nested to represent hierarchical data:
JSON vs CSV Format
CSV stores the same data as flat rows — JSON can represent nested relationships. If you have a CSV file and need it in JSON format, use our free CSV to JSON converter. For a detailed comparison, read our CSV vs JSON guide.
How to Validate JSON
To check if your JSON is valid:
- Use
JSON.parse()in a browser console — throws an error if invalid - Use JSONLint.com for online validation
- Most code editors (VS Code, WebStorm) highlight JSON errors automatically
Using JSON in JavaScript
Have a CSV File to Convert to JSON?
Use our free online tool — paste your CSV and get properly formatted JSON instantly.
Convert CSV to JSON Free →