Format JSON

Validate and format JSON. Interactive tree view. For free, forever.
Input JSON
Formatted JSON
Input JSON

Private and secure

Everything happens in your browser. Your files never touch our servers.

Blazing fast

No uploading, no waiting. Convert the moment you drop a file.

Actually free

No account required. No hidden costs. No file size tricks.

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.

Syntax & encoding: the precise bits that keep systems talking

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).

Numbers: deceptively simple, surprisingly sharp

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.

Beyond vanilla JSON: pointers, patches, and merge-patches

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.

Schemas & types: validating and generating

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.

Streaming & big data: JSON lines and sequences

Classic JSON expects one complete text per payload, which complicates streaming logs and long-lived responses. Two patterns help:

  • JSON Text Sequences (RFC 7464): a stream of UTF-8 JSON texts, each prefixed by the Record Separator (U+001E) and ended with LF; registered as application/json-seq.
  • NDJSON / JSON Lines: each line is a standalone JSON value—easy to tail, gzip, and map-reduce (ndjson.org, jsonlines.org). It’s popular in bulk APIs, e.g., Elasticsearch’s Bulk API.

Binary cousins: when text isn’t compact enough

When bandwidth or speed dominates, “binary JSON” formats preserve JSON’s data model while trading human readability for efficiency:

  • BSON (MongoDB’s native format) adds types like binary, datetime, and typed integers (bsonspec.org).
  • MessagePack is compact and schema-free, widely implemented across languages (msgpack.org).
  • CBOR standardizes an extensible, compact format (with JSON transcoding guidance) and is common in IoT/constrained contexts (RFC 8949, cbor.io).
  • Smile (from the Jackson ecosystem) encodes JSON with optional back-references for repeated names/values (jackson-dataformat-smile).

Security notes: old tricks and modern fixes

Because JSON is just text, most risks come from how you transport and handle it:

  • JSONP (requesting data via <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 hijacking: naïve GET endpoints returning sensitive arrays could be stolen via cross-origin script tags in older browsers; mitigations include POST with CSRF protections or prefixing with a non-JSON sentinel (OWASP: JSON Hijacking).
  • JSON injection: treat JSON as data, not code; escape diligently and validate inputs (OWASP: JSON Injection).

Media types & heritage

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.

Practical tips for robust JSON in production

A quick word on “friendlier JSONs”

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).

Frequently Asked Questions

What is JSON?

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.

Why do I need to format JSON?

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.

What does JSON validation do?

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.

What's the difference between code view and tree view?

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.

Is my JSON data secure?

Yes! All JSON formatting and validation happens entirely in your browser. Your data never leaves your computer, ensuring complete privacy and security.

Can I upload a JSON file?

Yes, you can upload a JSON file using the 'Open file' button. The tool will read the file and display the formatted output immediately.

What are common JSON errors?

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.

Can I copy the formatted JSON?

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.