Looking for cloud-based phone profiles? Check out our technical analysis of GeeLark. Discover GeeLark

JSON Beautifier & Validator

5 of 1 ratings

Paste JSON on the left, open a file or drop it on the box. It is checked as you type: a mistake is shown with its line and column, valid JSON appears formatted on the right and can be copied or downloaded. Nothing is uploaded: your JSON stays in your browser.

You can also drop a .json file on the box.
Orders the keys of every object alphabetically. Off: the keys stay in the order you wrote them.

To check that the JSON follows a JSON Schema (required fields, types, allowed values), use the JSON Schema Validator.

JSON Beautifier and Validator Online

Paste JSON or open a file and see it in a readable form: indented, one value per line. The same page checks the syntax as you type and tells you the exact line and column of a mistake. The result can be copied or downloaded as a file, formatted or minified. Everything happens in your browser, so your data, keys and tokens are never uploaded.

What a JSON beautifier does

APIs and web services usually send JSON as one long "minified" line without spaces or line breaks, to keep it small. A JSON beautifier (also called a JSON formatter or pretty printer) turns that line into a tree of nested levels with indentation, so that a person can read it. The Minify button does the opposite and removes all the white space.

  • Only white space changes. Many tools read the JSON and write it again, and that changes the data: long numbers such as 12345678901234567890 lose digits, 1.0 becomes 1, Cyrillic text turns into \u041f..., and keys change their order. This tool copies every number, string and key as you wrote it and only adds or removes spaces and line breaks.
  • Open file (or drop a file on the box) reads a .json file from your computer; Download saves the result, for example config.min.json after Minify.
  • Indent of 2 spaces, 4 spaces or a tab. Sort keys orders the keys of every object alphabetically; by default the order you wrote is kept.
  • It is meant for the text of API responses, configuration and data files. The check itself is fast (a 12 MB file is read in a fraction of a second), but a text box that holds many megabytes is slow to draw: up to 1 or 2 MB feels instant, about 8 MB of result takes a few seconds.

How the validator finds mistakes

The text is read by the tool itself, according to the JSON standard (RFC 8259), so the message is the same in every browser. It shows the line and column, the line itself with a pointer under the mistake, and a hint. The "Go to the error" button selects the place in the text. The most common mistakes it recognises:

  • a comma after the last item or property (trailing comma), or a missing comma between two items;
  • single quotes instead of double quotes, and property names without quotes;
  • comments (//, /* */, #), which JSON does not have;
  • missing or extra brackets, with the place where the unclosed bracket was opened;
  • values from other languages: True, None, undefined, NaN, Infinity;
  • invalid numbers: 01, .5, +1, 1., 0x1F;
  • a line break inside a string, an unknown escape such as \x, and characters that only look right: typographic quotes, a non-breaking space, a zero-width space.

A key that appears twice in the same object is legal JSON, but almost always a mistake, so the tool lists such keys as a warning. A byte order mark at the start of the text is ignored.

Strict JSON, not JSON5 or JSONC

The validator accepts exactly what JSON allows. Comments, trailing commas and single quotes are errors, even where some programs tolerate them. For example, tsconfig.json is JSONC, which allows comments and trailing commas, so the validator reports them. A JavaScript file such as astro.config.mjs or vite.config.js is code, not JSON, and cannot be checked here; package.json is JSON and can.

JSON, XML and CSV in short

  • JSON: nested objects and lists, with the types string, number, true/false and null. The usual format of web APIs and configuration. No comments, no attributes.
  • XML: nested tags with attributes and namespaces, checked by XSD schemas; more verbose, common in older systems, SOAP and documents.
  • CSV: a flat table of text with a header row; no types and no nesting, but it opens in a spreadsheet.

This page works with JSON only: it does not convert between these formats. To check that a JSON document has the right structure (required fields, types, allowed values), use the JSON Schema Validator.

Limitations

  • Nesting deeper than 2000 levels is reported as an error.
  • The whole text is held in the memory of the browser and shown in a text box, so very large files (more than 10 MB) are slow, most of all on a phone.
  • Only the first syntax mistake is shown: fix it and the next one, if any, appears at once.
  • The result is available only for valid JSON: with a mistake, the right-hand box stays empty and the left side shows what to fix.

Similar tools

JSON Schema Validator

Validate JSON against a JSON Schema online: Draft-04, Draft-07, 2019-09 and 2020-12. Every error with its path, line and column and a plain explanation. Works in your browser, nothing is uploaded.

11
HTML & CSS Minifier Online: Compress HTML and CSS Code

HTML and CSS minifier online: remove comments, spaces and line breaks, and see how many bytes you save. Safe for strings, URLs and pre blocks. In your browser.

10
Markdown to HTML

Convert Markdown to HTML online. Strict classic Markdown (CommonMark), live preview, optional front matter. Works in your browser, nothing is uploaded.

15

Popular tools