JSON Syntax is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is derived from JavaScript object notation but is language-independent.

Core Structure

  • Data is organized in key-value pairs, where each key must be a string enclosed in double quotes ("key"), followed by a colon (:), and then a value.

  • Objects are enclosed in curly braces {} and contain zero or more key-value pairs, separated by commas.

  • Arrays are enclosed in square brackets [] and contain zero or more values of any type, also separated by commas.

Valid Data Types

JSON supports six data types:

  • String: A sequence of Unicode characters, enclosed in double quotes ("example").

  • Number: A signed decimal number, including integers and floating-point values (e.g., 42, -3.14).

  • Boolean: Either true or false (lowercase only).

  • Null: Represents the absence of a value (null).

  • Object: A collection of name-value pairs ({"name": "value"}).

  • Array: An ordered list of values ([1, "two", true]).

Key Rules

  • No trailing commas are allowed after the last item in an object or array.

  • No comments are allowed (//, /* */, or #).

  • Keys must be strings in double quotes — single quotes are invalid.

  • Values must be one of the six valid types — functions, dates, undefined, NaN, Infinity, and -Infinity are not valid in JSON.

  • Whitespace is allowed but insignificant — spaces, tabs, line feeds, and carriage returns can appear around structural characters.

Example

{
  "name": "Alice",
  "age": 30,
  "isStudent": false,
  "grades": [85, 90, 78],
  "address": {
    "street": "123 Main St",
    "city": "Wonderland"
  }
}

This format is widely used in APIs, configuration files, and data storage due to its simplicity and compatibility across programming languages.

🌐
W3Schools
w3schools.com › js › js_json_syntax.asp
JSON Syntax
JSON data is written as name/value pairs (aka key/value pairs).
text-based open standard designed for human-readable data interchange
whitespace
object
combox respuesta json
JSON (JavaScript Object Notation, pronounced /ˈdʒeɪsən/ or /ˈdʒeɪˌsɒn/) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs … Wikipedia
Factsheet
JavaScript Object Notation
Filename extension .json
Internet media type application/json
Factsheet
JavaScript Object Notation
Filename extension .json
Internet media type application/json
🌐
JSON
json.org
JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition - December 1999.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or ...
🌐
Wikipedia
en.wikipedia.org › wiki › JSON
JSON - Wikipedia
March 6, 2005 - The current ECMA standard states, "The JSON syntax does not impose any restrictions on the strings used as names, does not require that name strings be unique, and does not assign any significance to the ordering of name/value pairs." Objects are delimited with curly brackets and use commas to separate each pair, while within each pair, the colon ":" character separates the key or name from its value.
🌐
Hostinger
hostinger.com › home › tutorials › what is json: understanding syntax, storing json data and downloadable cheat sheet
What Is JSON? Syntax, Examples + Cheat Sheet
September 9, 2025 - JSON syntax consists of two core elements – values that are one of the six available data types and keys that are strings.
Find elsewhere
🌐
HashiCorp Developer
developer.hashicorp.com › terraform › configuration language › syntax › json configuration syntax
JSON Configuration Syntax - Configuration Language | Terraform | HashiCorp Developer
November 19, 2025 - Learn about the JSON-compatible language syntax, including file structure, expression mapping, block mapping, and block-type-specific exceptions.
🌐
JAXB
javaee.github.io › tutorial › jsonp001.html
Introduction to JSON
JSON defines only two data structures: objects and arrays. An object is a set of name-value pairs, and an array is a list of values.
🌐
TutorialsPoint
tutorialspoint.com › home › json › json syntax
Understanding JSON Syntax
March 14, 2013 - Learn the essential syntax of JSON, including key-value pairs, data types, and best practices for writing JSON data.
🌐
RestfulAPI
restfulapi.net › home › json › json syntax
JSON Syntax
November 3, 2023 - A JSON document may contain information separated by the following separators or tokens. 1. JSON name-value pairs example Name-value pairs have a colon between them as in "name" : "value". JSON names are on the ... Read more
🌐
Micro Focus
microfocus.com › documentation › silk-performer › 195 › en › silkperformer-195-webhelp-en › GUID-6AFC32B4-6D73-4FBA-AD36-E42261E2D77E.html
JSON Object Structure
A JSON object contains zero, one, or more key-value pairs, also called properties. The object is surrounded by curly braces {}. Every key-value pair is separated by a comma.
🌐
mabl help
help.mabl.com › hc › en-us › articles › 19078205331348-JSON-structure-and-syntax
JSON structure and syntax – mabl help
A JSON object contains one or more properties that are expressed as key-value pairs, separated by commas and enclosed with curly braces { }.
🌐
W3Schools
w3schools.com › js › js_json.asp
W3Schools.com
JSON is similar to the syntax for creating JavaScript objects.
🌐
IETF
datatracker.ietf.org › doc › html › rfc7159
RFC 7159 - The JavaScript Object Notation (JSON) Data Interchange Format
It is derived from the object literals ... Third Edition [ECMA-262]. JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays)....
🌐
DigitalOcean
digitalocean.com › community › tutorials › an-introduction-to-json
An Introduction to JSON | DigitalOcean
August 24, 2022 - Each of the data types that are passed in as values into JSON will maintain their own syntax, meaning strings will be in quotes, but numbers will not be.
🌐
Oracle
docs.oracle.com › en › database › oracle › oracle-database › 21 › adjsn › json-data.html
JSON Developer's Guide
December 6, 2022 - JSON Syntax and the Data It Represents Standard JSON values, scalars, objects, and arrays are described.
🌐
IETF
datatracker.ietf.org › doc › html › rfc8259
RFC 8259 - The JavaScript Object Notation (JSON) Data Interchange Format
It is derived from the object literals ... Third Edition [ECMA-262]. JSON can represent four primitive types (strings, numbers, booleans, and null) and two structured types (objects and arrays)....
🌐
Oracle
docs.oracle.com › javaee › 7 › tutorial › jsonp001.htm
19.1 Introduction to JSON - Java Platform, Enterprise Edition: The Java EE Tutorial (Release 7)
JSON defines only two data structures: objects and arrays. An object is a set of name-value pairs, and an array is a list of values.
🌐
WsCube Tech
wscubetech.com › resources › javascript › json
JSON in JavaScript: Syntax, Uses, Examples
October 25, 2025 - Learn how to use JSON in JavaScript with proper syntax, examples, and access methods. Understand parsing, stringifying, and handling JSON data efficiently.