DEVELOPER TOOL

JSON Formatter

Pretty-print, minify, and validate JSON.

Active file

untitled.json

UTF-8 · 0 bytes · 0 lines

Waiting for input

Native JSON formatting can round large numbers, keep only the last duplicate key, reorder numeric keys, and normalize escapes. Original input stays unchanged. Validation checks syntax only.

JSON · UTF-8
JSON0 characters / 1 MiB max
JSON · UTF-8
JSON0 bytes

Processing summary

Local browser · 1 MiB input · 4 MiB output · 128 depth

Input size
0 / 1,048,576 bytes
Output size
0 / 4,194,304 bytes
Nesting depth
not measured / 128

Validation is local and syntax-only. The formatter normalizes indentation, escapes and whitespace, but does not enforce a specific schema.

Waiting for input

Processing is local in your browser — nothing is uploaded.

Input 1 MiB UTF-8 · Output 4 MiB · Maximum depth 128

What is JSON?

JSON stands for JavaScript Object Notation. It is a text format used to exchange data between applications, including API responses, configuration and exported records. Objects hold named properties; arrays hold ordered values.

A JSON value can be an object, array, string, number, boolean or null. A top-level value such as false or 42 can be valid JSON even though it is not an object. Object property names and strings must use double quotes.

Formatting, minifying and validating JSON

Pretty-printing adds indentation and line breaks so nested structures are easier to inspect. Minification removes unnecessary whitespace from the serialized result, which is useful when compact text is needed. Neither operation changes the original text in the input editor.

Syntax validation checks whether the text can be parsed as JSON without rewriting it. It is different from JSON Schema validation: valid syntax does not prove that required fields exist, that values have the right business meaning or that the receiving API will accept them.

Common reasons JSON is invalid

JSON is stricter than a JavaScript object literal. The following are common causes of parsing errors:

  • Single-quoted strings or property names without double quotes.
  • A trailing comma after the final object property or array item.
  • Comments, undefined, NaN or Infinity, none of which are JSON values.
  • Missing commas, colons or closing brackets, or unescaped control characters in strings.

Formatting limits and precision

This formatter uses the native JavaScript JSON parser and serializer. Formatting is not lossless: large numbers can lose precision, duplicate property names keep only their last value, integer-like keys can be reordered, and escapes or numeric spelling can normalize. Syntax validation leaves the input text unchanged.

For example, an integer above the JavaScript safe-integer range may change when reserialized. Keep identifiers as strings in the source system when exact digits matter. Preserve the original document if duplicate keys, numeric spelling or exact byte representation are significant.

Input is limited to 1 MiB of UTF-8 text and output to 4 MiB. Formatting is limited to 128 nesting levels. Numbers that parse to a non-finite value are rejected during formatting rather than silently becoming null. These are processing limits, not a claim that every valid JSON document fits this tool.

Local JSON processing and privacy

Pasted text and opened files are processed in the browser, not sent to a document-upload endpoint. This tool does not put JSON input in the URL or save it to browser storage. Output is rendered as text rather than interpreted as HTML.

Normal site navigation and visitor analytics still apply. Local processing is not an absolute security guarantee: browser extensions, your device and any copies or downloads you create remain part of your own security environment.

JSON formatter questions

A formatter parses and serializes JSON with readable whitespace. A validator checks syntax without rewriting the input. This tool checks JSON syntax, not a JSON Schema or API-specific rules.

Cookie consent

We use cookies to run the site and improve your experience. You can choose which types to allow.

Cookie preferences
Manage preferences