JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that has become the de facto standard for data exchange on the web. Originally derived from JavaScript, JSON is language-independent and supported by virtually every modern programming language.
JSON Syntax Basics
JSON is built on two structures:
{}. Each name is a string followed by a colon, and pairs are separated by commas.[]. Values are separated by commas.Data Types
JSON supports six data types:
"hello"42, 3.14true or falsenull{"key": "value"}[1, 2, 3]Working with JSON in JavaScript
JavaScript provides two built-in methods for JSON:
JSON.parse() — converts a JSON string into a JavaScript objectJSON.stringify() — converts a JavaScript object into a JSON stringCommon Use Cases
package.json, tsconfig.json, etc.localStorageBest Practices
Try our JSON Formatter to format and beautify your JSON data instantly.
