Languages and formats
JSON
Summary
JSON (JavaScript Object Notation) is a lightweight, text-based format for exchanging data between programs, and a common format for web APIs, including WordPress's REST API. Douglas Crockford, who dates his work on it to 2001 and says he does not claim to have invented it, described it on JSON.org late in 2002. It is now defined by RFC 8259 and ECMA-404, both from December 2017, and its JSON-LD form carries much of the structured data that search engines read.
What JSON is
JSON, short for JavaScript Object Notation, is a plain-text format for sending structured data between programs. Its home page calls it “a lightweight data-interchange format” that is easy for people to read and write and easy for machines to parse and generate.1
The format grew out of JavaScript. The current internet standard, RFC 8259, says JSON is derived from the object literals of JavaScript as defined in the third edition of the ECMAScript standard, published in December 1999.2 JSON itself does not depend on any one programming language, though it uses conventions familiar to programmers of C, Java and their relatives.1
JSON is built from two structures:1
- Objects. An unordered set of name/value pairs inside curly braces, such as {“name”: “Main Street Bakery”, “open”: true}. Programming languages call this an object, record or dictionary.
- Arrays. An ordered list of values inside square brackets, such as [“Mon”, “Tue”, “Wed”].
A value can be a string in double quotes, a number, true, false, null, an object or an array, and objects and arrays can be nested inside each other.1 RFC 8259 sums this up as four primitive types (strings, numbers, booleans and null) and two structured types (objects and arrays), held together by six structural characters: the two kinds of brackets, the colon and the comma.2
JSON is stricter than the JavaScript it came from. Names must be in double quotes, trailing commas are not allowed, and there is no support for comments or for the JavaScript values undefined, NaN and Infinity.3 A single trailing comma is enough to make a JSON document invalid.3
On the web, JSON travels with the media type application/json and is saved in files ending in .json. The registration with IANA, the body that keeps the list of internet media types, names Douglas Crockford as author and points to RFC 8259 as the specification.4
Origins: Douglas Crockford and State Software
JSON is closely tied to Douglas Crockford, who has described its beginnings in a talk he gave under the title “The JSON Saga,” including at the Oredev conference in 2009.5 The account below is Crockford’s own, taken from an unofficial transcript (made by Mike Amundsen) of a version of the talk posted on YouTube in 2011. In it, Crockford says the story starts in 2001, when he and Chip Morningstar started a company to build frameworks for web applications. It became State Software.6 A 2024 report on a later Crockford talk also dates his work on JSON to 2001.7
Crockford is careful about the word “invent.” In the talk he says: “I do not claim to have invented JSON because it already existed in nature.”6 He points out that someone at Netscape was already sending JavaScript array literals as data as early as 1996.6
According to the same talk, the first message in the new format was sent in Morningstar’s garage. Early on the team hit a snag: a message used the name “do,” which is a reserved word in JavaScript. Crockford says that was how they found the “unquoted name problem,”6 and JSON requires every name to be a string in double quotes.3
The name came next. The team first called the format JSML, the JavaScript Message Language, but dropped it on finding a Java standard with the same initials, the Java Speech Markup Language. They settled on JSON, JavaScript Object Notation.6
Crockford says he then decided to declare the format a standard. He bought the JSON.org domain and, very late in 2002, put up a one-page website describing it.6 The license on the reference code posted there is dated 2002 and adds one unusual condition to an otherwise permissive license: the software is to be used for good, not evil.8
On December 6, 2006, at the XML 2006 conference in Boston, Crockford made his case in a talk later posted as “JSON: The Fat-Free Alternative to XML.”9 In it he argued that JSON did not need to be extensible, and that it was a data format, not a document format.9
The format has stayed the same since. Writing about Crockford’s talk at the WeAreDevelopers World Congress in 2024, Chris Heilmann noted that JSON had remained unchanged since its start, and reported Crockford’s view that the JSON layer would stay as it is.7
From a web page to an internet standard
JSON has been written down in four places: Crockford’s own site, the Internet Engineering Task Force (IETF, which publishes internet standards as numbered RFCs), Ecma International (which also publishes ECMAScript, the standard behind JavaScript, as ECMA-26210) and the International Organization for Standardization (ISO).
| Document | Date | What it did |
|---|---|---|
| RFC 4627 | July 2006 | Crockford’s description of JSON, which registered application/json. Informational, not a standard.11 |
| ECMA-262, 5th edition | December 2009 | Added a built-in JSON object to JavaScript.1012 |
| ECMA-404, 1st edition | October 2013 | Ecma’s standard for the JSON syntax.13 |
| RFC 7159 | March 2014 | Moved JSON onto the IETF standards track.14 |
| ISO/IEC 21778:2017 | November 2017 | ISO edition of the JSON syntax.15 |
| RFC 8259 and ECMA-404, 2nd edition | December 2017 | The current versions, written to agree with each other.213 |
RFC 4627 (2006). Crockford wrote this memo, which the RFC Editor published in July 2006 as an Informational document. It states that JSON’s design goals were to be “minimal, portable, textual, and a subset of JavaScript.”11 Under its rules a complete JSON text had to be an object or an array.11
The memo also deals with eval(), the JavaScript function that runs a string as code. It says JSON text can be passed safely to eval() only after checking that every character outside of strings belongs to a JSON token.11
JavaScript gets JSON built in (2009). The fifth edition of ECMA-262, dated December 2009, added support for the JSON format to the language itself.1012 Its JSON object has two main methods: JSON.parse turns JSON text into data, and JSON.stringify turns data into JSON text.3 MDN Web Docs lists the JSON object as widely available across browsers since July 2015.3
RFC 7159 (2014). Edited by Tim Bray, this replaced RFC 4627 in March 2014 and put JSON on the IETF standards track. It changed the definition of a JSON text so that it can be any JSON value, such as a single string or number.14
ECMA-404 (2013, 2017). Ecma published the first edition in October 2013 and the second in December 2017. It defines only the syntax of valid JSON texts, not what the data means or how languages should store it.13 ISO published the same syntax as ISO/IEC 21778 in November 2017.15
RFC 8259 (2017, current). Published in December 2017 and also edited by Bray, RFC 8259 replaced RFC 7159 and is the IETF’s full Internet Standard for JSON, known as STD 90.216 It made ECMA-404 a normative reference, and the two documents are meant to have no inconsistencies in what counts as a JSON text.2 It also requires JSON sent between systems outside a closed group to use the UTF-8 text encoding, without a byte order mark.2
RFC 8259 is open about where programs disagree. Names inside an object should be unique, and when they are not, the result is unpredictable: some parsers keep the last value, some report an error and some keep every pair.2 For numbers, it advises that software using standard double-precision numbers will agree exactly on whole numbers up to 2 to the power of 53, minus 1.2
A stricter profile called I-JSON, published as RFC 7493 in March 2015, tightens that advice: it requires UTF-8 and unique names, and recommends keeping numbers within double precision and writing dates in the RFC 3339 format.17
A true subset of JavaScript (2019). For years JSON was not quite a subset of JavaScript. Two invisible characters, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR, were allowed inside JSON strings but not inside JavaScript strings.18 ECMAScript 2019, the 10th edition of ECMA-262 dated June 2019, allowed them in JavaScript string literals to align the language with JSON.19 Since then, any JSON text is a valid JavaScript expression.3
JSON and XML in web APIs
A web API (application programming interface) is a set of addresses that programs, rather than people, call over HTTP to get or send data. Many APIs answer in JSON today, including WordPress’s own.20 In the early 2000s, the data format named in the best-known descriptions of web applications was XML.
XML, the Extensible Markup Language, became a W3C Recommendation on February 10, 1998. Its editors were Tim Bray, Jean Paoli and C. M. Sperberg-McQueen, and it was designed as a subset of SGML that could be served and processed on the web the way HTML was.21 Bray later edited both RFC 7159 and RFC 8259.142
When Jesse James Garrett named Ajax on February 18, 2005, his list of its parts included XML and XSLT for exchanging and handling data, and XMLHttpRequest for fetching data in the background.22 The browser feature behind it still carries XML in its name, but the current standard says the name “is historical and has no bearing on its functionality,” and it can return a response parsed as JSON.23
Crockford’s 2006 argument for JSON over XML rested on a few points:9
- It matches how programs store data. JSON objects and arrays map onto the records, dictionaries, arrays and lists of most languages, so data needs no restructuring.
- It is smaller and simpler. The syntax is much simpler than XML’s, which makes parsing more efficient.
- It does different work. XML is a document format, built to mark up text. JSON is a data format.
XML did not disappear. The sitemap files that tell search engines which pages a site has are XML, and must be saved as UTF-8.24 WordPress also still includes an XML-RPC interface, an older XML-based way for outside apps to post to a site, switched on by default since version 3.5.25
JSON-LD and structured data for search
Structured data is extra, machine-readable information about a page, such as a business’s address or a product’s price. Google describes it as a standardized format for providing information about a page and classifying its content.26 JSON is one of the ways to write it.
Schema.org. On June 2, 2011, Google announced schema.org, a shared vocabulary for structured data backed by Google, Bing and Yahoo.27 Its FAQ says the project first focused on Microdata, a way of tagging HTML elements, and now supports several syntaxes, including RDFa and JSON-LD.28
JSON-LD. JSON-LD, short for JSON for Linked Data, is a W3C standard for describing things and the links between them in ordinary JSON. Version 1.0 became a W3C Recommendation on January 16, 2014, edited by Manu Sporny, Gregg Kellogg and Markus Lanthaler.29 Version 1.1 followed on July 16, 2020; documents written for 1.0 remain compatible with it, apart from a few noted exceptions.30
JSON-LD adds a few special names that start with @. The @context name maps the terms in a document to web addresses that define them, @id gives each thing a unique identifier and @type says what kind of thing it is.30 JSON-LD has its own media type, application/ld+json, with the file extension .jsonld.31
What Google recommends. Google Search accepts JSON-LD, Microdata and RDFa, and says all three are “equally fine” if the markup is valid. It still recommends JSON-LD where a site’s setup allows, calling it the easiest for site owners to implement and maintain at scale. JSON-LD goes in a script tag and can sit in the page’s head or body, apart from the visible text.26
Google’s local business documentation, for example, shows a restaurant described in a script element of type application/ld+json, with @context set to https://schema.org, @type set to Restaurant, and fields for the name, address, telephone number and price range.32
As of October 21, 2026, W3Techs finds JSON-LD on 56.2% of websites. Open Graph appears on 72.6% and Microdata on 21.0%, while 19.9% of sites use no structured data format it tracks. A site can use more than one.33
Structured data is not a ranking shortcut. Google says it does not guarantee that structured data will appear in search results, and that a structured data manual action, a penalty applied by its reviewers, removes a page’s eligibility for rich results without affecting its ranking.34
JSON in WordPress
WordPress uses JSON for its own REST API. The handbook says the API lets applications interact with a site by “sending and receiving data as JSON,” and calls it the foundation of the WordPress block editor.20
WordPress 4.7, released on December 6, 2016, added REST API endpoints for posts, comments, terms, users, meta and settings to WordPress itself.35 On a site with pretty permalinks, a request to the /wp-json/ address returns a JSON list of the available routes, and a GET request to /wp-json/wp/v2/posts returns a list of posts. Sites without pretty permalinks use ?rest_route= in the address instead.36
SEO plugins can add JSON-LD to each page. Yoast, for example, says it includes JSON-LD in the HTML source, normally in the head, and connects the pieces on each page to one another through their @id values.37
Timeline
- JSON-LD 1.1 becomes a W3C Recommendation30
- ECMAScript 2019 makes every JSON text valid JavaScript19
- RFC 8259 and the second edition of ECMA-404 are published2
- ISO publishes the JSON syntax as ISO/IEC 21778:201715
- WordPress 4.7 adds REST API content endpoints that speak JSON35
- RFC 7493 defines the stricter I-JSON profile17
- RFC 7159 puts JSON on the IETF standards track14
- JSON-LD 1.0 becomes a W3C Recommendation29
- Ecma publishes the first edition of ECMA-40413
- Google, Bing and Yahoo announce schema.org27
- ECMAScript 5th edition adds a built-in JSON object10
- Crockford presents JSON as a fat-free alternative to XML at XML 20069
- RFC 4627 registers the application/json media type11
- By Crockford's account, he puts up a one-page JSON.org site very late in the year6
- Crockford and Chip Morningstar start the company that became State Software, by Crockford's account6
What it means for your website
Most site owners never write JSON by hand, but it touches a site in three places: search markup, the WordPress REST API and any tool that sends data between apps.
- Use JSON-LD for search markup. Google recommends it over Microdata and RDFa where your setup allows.26 SEO plugins such as Yoast can output it for you,37 so check what your site already adds before you paste in more.
- Mark up only what visitors can see. Google’s rules say not to mark up content that is not visible on the page, and to keep time-sensitive information up to date.34
- Do not break the code. One trailing comma or curly quote makes JSON invalid, because names and strings must use straight double quotes.32 Paste markup into a plain-text editor, never a word processor, and keep the names in straight double quotes.
- Validate before and after. Google’s Rich Results Test checks markup for its search features, and Search Console reports problems after launch.26 Google says to fix critical errors it reports.32
- Do not turn off the WordPress REST API. The handbook says you should not disable it because parts of the admin depend on it. If you want to block anonymous access, it shows how to require logged-in users instead.38
- Do not block pages with markup. Pages carrying structured data must stay open to Googlebot in robots.txt.34
We build on WordPress every week. Our guide to websites and SEO covers what each builder lets you control, and websites and AI search looks at how the same pages are read by AI tools.
See also
- JavaScript
- XML (coming soon)
- Ajax (coming soon)
- HTTP
- WordPress
- Websites and SEO
- Seo
References
- Introducing JSON. JSON.org. accessed October 22, 2026.
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format. Tim Bray (ed.), Internet Engineering Task Force, RFC Editor. 2017-12. accessed October 22, 2026.
- JSON. MDN Web Docs (Mozilla). accessed October 22, 2026.
- Media type application/json. Internet Assigned Numbers Authority (IANA). accessed October 22, 2026.
- The JSON Saga (session listing, Oredev 2009). Oredev. 2009. accessed October 22, 2026.
- The JSON Saga (unofficial transcript of a talk by Douglas Crockford). Mike Amundsen, mamund.site44.com. accessed October 22, 2026.
- Douglas Crockford: JSON and Beyond. Chris Heilmann, WeAreDevelopers Magazine. 2024-10-07. accessed October 22, 2026.
- The JSON License. JSON.org. accessed October 22, 2026.
- JSON: The Fat-Free Alternative to XML. Douglas Crockford, JSON.org (presented at XML 2006, Boston). 2006-12-06. accessed October 22, 2026.
- ECMA-262: ECMAScript language specification (editions and archives). Ecma International. accessed October 22, 2026.
- RFC 4627: The application/json Media Type for JavaScript Object Notation (JSON). Douglas Crockford, Internet Engineering Task Force, RFC Editor. 2006-07. accessed October 22, 2026.
- ECMAScript Language Specification, 5.1 Edition. Ecma International. 2011-06. accessed October 22, 2026.
- ECMA-404: The JSON data interchange syntax. Ecma International. 2017-12. accessed October 22, 2026.
- RFC 7159: The JavaScript Object Notation (JSON) Data Interchange Format. Tim Bray (ed.), Internet Engineering Task Force, RFC Editor. 2014-03. accessed October 22, 2026.
- ISO/IEC 21778:2017 Information technology: The JSON data interchange syntax. International Organization for Standardization. 2017-11. accessed October 22, 2026.
- Information on RFC 8259 (STD 90). RFC Editor. 2017-12. accessed October 22, 2026.
- RFC 7493: The I-JSON Message Format. Tim Bray (ed.), Internet Engineering Task Force, RFC Editor. 2015-03. accessed October 22, 2026.
- Proposal: Subsume JSON (a.k.a. JSON superset). Ecma TC39, GitHub. accessed October 22, 2026.
- ECMAScript 2019 Language Specification (ECMA-262, 10th edition). Ecma International. 2019-06. accessed October 22, 2026.
- REST API Handbook. WordPress Developer Resources, WordPress.org. accessed October 22, 2026.
- Extensible Markup Language (XML) 1.0. World Wide Web Consortium (W3C). 1998-02-10. accessed October 22, 2026.
- Ajax: A New Approach to Web Applications. Jesse James Garrett, Adaptive Path (2007 print copy of the essay, hosted by MIT). 2005-02-18. accessed October 22, 2026.
- XMLHttpRequest Living Standard. WHATWG. 2026-10-19. accessed October 22, 2026.
- Sitemaps XML format. sitemaps.org. accessed October 22, 2026.
- XML-RPC Support. WordPress Codex, WordPress.org. accessed October 22, 2026.
- Introduction to structured data markup in Google Search. Google Search Central. 2025-12-10. accessed October 22, 2026.
- Introducing schema.org: Search engines come together for a richer web. R.V. Guha, Official Google Blog. 2011-06-02. accessed October 22, 2026.
- Schema.org FAQ. Schema.org. accessed October 22, 2026.
- JSON-LD 1.0: A JSON-based Serialization for Linked Data. World Wide Web Consortium (W3C). 2014-01-16. accessed October 22, 2026.
- JSON-LD 1.1: A JSON-based Serialization for Linked Data. World Wide Web Consortium (W3C). 2020-07-16. accessed October 22, 2026.
- Media type application/ld+json. Internet Assigned Numbers Authority (IANA). accessed October 22, 2026.
- Local business (LocalBusiness) structured data. Google Search Central. 2026-09-08. accessed October 22, 2026.
- Usage statistics of structured data formats for websites. W3Techs. 2026-10-21. accessed October 22, 2026.
- General structured data guidelines. Google Search Central. 2026-07-10. accessed October 22, 2026.
- WordPress 4.7 "Vaughan". WordPress.org News. 2016-12-06. accessed October 22, 2026.
- Key Concepts. REST API Handbook, WordPress.org. accessed October 22, 2026.
- Schema: technology and approach. Yoast developer portal. accessed October 22, 2026.
- Frequently Asked Questions. REST API Handbook, WordPress.org. accessed October 22, 2026.
Web Building Encyclopedia. First published October 22, 2026. Last reviewed October 22, 2026. Every fact on this page is linked to a source we opened. Spotted an error? Write to [email protected].