JavaScript JSON Guide
JSON (JavaScript Object Notation) is a lightweight data interchange format. JavaScript provides two methods for JSON serialization and parsing. The guide walks through Parsing JSON, Serializing JSON, Common Patterns. `JSON.parse()` converts a JSON string into a JavaScript value. It can accept an optional reviver function for transforming values during parsing. Invalid JSON throws a SyntaxError. `JSON.stringify()` converts a JavaScript value to a JSON string. It accepts optional replacer (filter or array of keys) and space (formatting) parameters. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual methods covered by this guide in the JSON category. Key APIs covered include JSON.stringify(), JSON.parse(). Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page.