JSON—JavaScript Object Notation—is the ubiquitous, text-based format for structured data exchange. It’s standardized by both the IETF as RFC 8259 and by Ecma International as ECMA-404, which together define the compact, language-agnostic syntax that powers modern APIs, logs, configs, and databases.
A JSON value is either an object, array, string, number, or one of the literals true, false, or null; objects map strings to values and arrays hold ordered values—with insignificant whitespace allowed around structural characters (RFC 8259, ECMA-404). Although JSON originated from JavaScript, it’s language-independent and supported virtually everywhere (MDN: JSON). On the wire, the de-facto and recommended encoding is UTF-8 (RFC 8259 §8.1). For extra interop safety, the I-JSON profile (RFC 7493) tightens rules around encodings and numeric ranges.
In JavaScript, the global JSON object exposes two workhorses:JSON.parse (with an optional reviver) and JSON.stringify (with replacer/spacing for pretty printing), as documented on MDN (parse, stringify).
JSON’s number grammar is decimal, but the spec doesn’t dictate precision or integer/float distinctions. Implementations choose how to represent them (RFC 8259 §6). In JavaScript and Node.js, Number is IEEE-754 double precision, meaning only integers in [−(2^53−1), 2^53−1] are exactly safe—see Number.MAX_SAFE_INTEGER and the BigInt type. This is why public APIs often ship IDs as strings and validate “safe integers” explicitly.
As usage matured, standards emerged to address and modify JSON in place. JSON Pointer (RFC 6901) is a tiny, slash-delimited syntax for locating values (e.g., /a/b/0) with escaping rules for ~ and /. JSON Patch (RFC 6902) models partial updates as ordered operations (add, remove, replace, move, copy, test) and travels as application/json-patch+json. For simpler diffs, JSON Merge Patch (RFC 7386) uses a document-shaped merge: present fields are added/replaced; setting a field to null deletes it. Many frameworks support one or both forms out of the box.
JSON itself is schemaless, but ecosystems lean on schemas for validation, documentation, and codegen. The JSON Schema 2020-12 family specifies constraints like type, properties, items, and composition keywords, and it aligns with OpenAPI 3.1. For code-generation-centric workflows, JSON Type Definition (RFC 8927) offers a deliberately less expressive language that maps predictably to mainstream type systems.
Classic JSON expects one complete text per payload, which complicates streaming logs and long-lived responses. Two patterns help:
application/json-seq.When bandwidth or speed dominates, “binary JSON” formats preserve JSON’s data model while trading human readability for efficiency:
Because JSON is just text, most risks come from how you transport and handle it:
<script> with a callback) was a pre-CORS workaround for cross-origin requests but is dangerous—it executes arbitrary script. Prefer CORS with real application/json responses (OWASP: JSONP Abuse).JSON debuted under RFC 4627 (2006); the registered media type is application/json, whose specification now points to RFC 8259. “Charset” parameters on JSON responses are generally unnecessary because UTF-8 is the default on the public internet.
Developers often want comments, trailing commas, or single-quoted strings in configs. That’s outside standard JSON, but JSON5 provides a well-documented superset for human-edited files. Avoid sending JSON5 over public APIs unless you control both ends.
JSON’s success comes from a small surface area, broad language support, and a ring of adjacent standards—pointers, patching, schemas, sequences—that cover the messy realities of distributed systems. Understand the fundamentals (syntax, encoding, numbers), lean on the right adjacent standards, and it will keep paying dividends across stacks and services (RFC 8259, ECMA-404, RFC 6901, RFC 6902, RFC 7386, JSON Schema, JTD, RFC 7464, NDJSON).
JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate. It's widely used for transmitting data in web applications.
Formatting JSON makes it human-readable by adding proper indentation and line breaks. This is especially useful when working with minified or compressed JSON data, debugging, or reviewing API responses.
JSON validation checks whether your JSON string conforms to the JSON specification. It identifies syntax errors like missing commas, unclosed brackets, or improper quotes, helping you catch errors early.
Code view displays the formatted JSON as text with syntax highlighting, similar to how it appears in a code editor. Tree view presents JSON as an interactive, collapsible structure where you can expand and collapse nested objects and arrays.
Yes! All JSON formatting and validation happens entirely in your browser. Your data never leaves your computer, ensuring complete privacy and security.
Yes, you can upload a JSON file using the 'Open file' button. The tool will read the file and display the formatted output immediately.
Common JSON errors include: missing commas between key-value pairs, using single quotes instead of double quotes for strings, trailing commas, unclosed brackets or braces, and unquoted keys.
Yes, use the 'Copy' button to copy the formatted JSON to your clipboard. This is useful for pasting the cleaned-up JSON into your code or documentation.