ConvertCSV

JSON for Beginners: Syntax, Types, and Real Examples

By Convert CSV Editorial TeamLast updated August 1, 2026

JSON explained for beginners. Learn the syntax, six data types, and how JSON powers APIs, config, and data exchange—with copy-paste examples.

What Is JSON?

JSON stands for JavaScript Object Notation. It is a plain-text format for describing structured data—records, lists, and nested details—that both humans and machines can read.

Despite the name, JSON is not tied to JavaScript. Every mainstream language reads and writes it, which is why it became the standard way for apps, APIs, and databases to exchange data.

A First Example

This is a valid JSON document.

{
  "orderId": "1001",
  "customer": {
    "name": "Ada Lovelace",
    "email": "ada@example.com"
  },
  "items": [
    { "sku": "A1", "qty": 2 },
    { "sku": "B2", "qty": 1 }
  ],
  "paid": true,
  "notes": null
}

What each part means

The outer braces make an object. Inside, keys point to values. Values can be strings, numbers, booleans, null, or more objects and arrays. That is the whole language.

The Six JSON Data Types

Everything in JSON is one of these six.

TypeExampleNotes
string"Ada"Double quotes only
number42, 3.14No leading zeros; no NaN/Infinity
booleantrue, falseLowercase
nullnullExplicit absence of value
array[1, 2, 3]Ordered list, any types
object{ "k": "v" }Unordered set of key/value pairs

Syntax Rules You Cannot Skip

JSON is strict, and that strictness is a feature—parsers cannot guess.

  • Keys and strings use double quotes.
  • No trailing commas after the last element.
  • No comments (standard JSON).
  • Only true, false, or null—no None, undefined, or yes/no.
  • Escape special characters (\", \\, \n) inside strings.

Where JSON Is Used

You already use JSON, even if you have not written any yet.

  • REST and GraphQL APIs (responses and requests).
  • Configuration files (package.json, tsconfig.json).
  • NoSQL document databases (MongoDB, DynamoDB).
  • Web app browser storage and logging.
  • AI/LLM tool calling payloads.

Reading JSON in Code

Two of the most common languages, side by side.

JavaScript

JSON.parse turns text into an object.

const text = '{"name": "Ada", "age": 36}';
const data = JSON.parse(text);
console.log(data.name);

Python

json.loads is the same idea.

import json
text = '{"name": "Ada", "age": 36}'
data = json.loads(text)
print(data["name"])

Writing JSON in Code

The reverse is just as easy.

JavaScript

JSON.stringify serializes to a string.

const obj = { name: "Ada", tags: ["math", "logic"] };
const text = JSON.stringify(obj, null, 2);

Python

json.dumps mirrors JSON.stringify.

import json
text = json.dumps({"name": "Ada", "tags": ["math", "logic"]}, indent=2)

From Spreadsheet to JSON

You do not have to write code to make JSON. If your data is in a spreadsheet, Convert CSV Online turns it into a JSON array in seconds.

  • Export your Excel sheet as CSV.
  • Open the CSV to JSON Converter.
  • Paste or upload the CSV.
  • Copy or download the resulting JSON.

Beginner Traps

These bite everyone once. Learn them now, save time later.

  • Using single quotes—JSON demands double.
  • Trailing commas after the last object or array element.
  • Confusing null (a value) with missing key (no value).
  • Sending a number as a string like "42" and then failing to parse it.
  • Assuming key order matters—it does not for correctness.

Real-World Examples

Three common places you will see JSON as a beginner.

Fetching an API

fetch(url) returns a Response; .json() gives you a plain object to work with.

package.json

Every Node.js project has one; it lists dependencies and scripts in JSON.

Postman payloads

When you build an API request in Postman or Insomnia, the body is usually JSON.

Best Practices

Habits that separate beginners from teammates who ship confidently.

  • Pretty-print files that people will read.
  • Use camelCase or snake_case consistently.
  • Store big IDs and codes as strings.
  • Format dates as ISO 8601.
  • Validate JSON with a linter before commit.

Why Use Convert CSV Online?

Convert CSV Online is free, browser-based, and requires no account for everyday conversions. It is the fastest way to turn a spreadsheet into JSON without writing a line of code. Client-side workflows work on Windows, macOS, and Linux browsers.

Learn by seeing

Convert real data and inspect the JSON structure to make the syntax stick.

Conclusion

JSON is small, strict, and everywhere. Learn the six types and the handful of syntax rules, and you can read and write structured data in any modern system.

FAQ

What is JSON in simple terms?

JSON is a plain-text format for structured data. It uses keys and values, arrays and objects, and is readable by both people and machines.

Is JSON the same as JavaScript?

No. JSON borrowed its syntax from JavaScript object literals, but every mainstream language reads and writes JSON.

What are the data types in JSON?

Six: string, number, boolean, null, array, and object.

Can JSON have comments?

Standard JSON cannot. JSON5 and JSONC are supersets that allow comments, but strict JSON parsers reject them.

How do I create JSON from a CSV?

Use Convert CSV Online’s CSV to JSON converter. Paste or upload the CSV and download the JSON array.

Why use JSON instead of XML or CSV?

JSON is smaller and simpler than XML for most web APIs, and richer than CSV for nested or typed data. Use CSV for flat tabular data, JSON for structured records.

References

Convert your CSV in the browser

Preview, clean, and convert CSV files free with Convert CSV Online—no installation and no account required for everyday conversions.