Skip to tools
4 min read·

What is JSON? A quick primer for developers

JSON (JavaScript Object Notation) is the lingua franca of the modern web. Learn its rules, common pitfalls and when to use it.

JSON Data formats API

What JSON actually is

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format. It represents structured data as a mix of objects (key–value pairs wrapped in curly braces), arrays (ordered lists wrapped in square brackets), strings, numbers, booleans and the value null. Despite its name, JSON is completely language-independent — nearly every programming language ships with a JSON parser out of the box.

Where you will meet it

JSON is the default payload format for REST and GraphQL APIs, the storage format for many NoSQL databases (MongoDB, Firestore), and the go-to config format for tools such as npm, VS Code and TypeScript.

Common gotchas

Keys must be double-quoted. Trailing commas are not allowed. Comments are not part of the spec. Numbers must be finite (no NaN or Infinity). Fix these three things and 90% of "invalid JSON" errors disappear.

Try it right now

Use our JSON Formatter to prettify or validate any snippet, our JSON Minifier to shrink it for production, or the JSON Tree Viewer to explore deep API responses interactively.

Try it in Code Formatter Pro

Every tool mentioned in this article runs entirely inside your browser — no signup, no uploads.

Open the toolkit