Data Formats

JSON Formatter & Validator

Format, minify, sort, and validate JSON with precise error positions.

  • History kept on this deviceRecent results are kept in this browser's local storage until you clear them.
  • Runs in your browserProcessing happens in this page. No application server receives your input.

Input

Output

What each action does

  • Format rewrites the document with two-space indentation.
  • Minify removes every optional space and line break.
  • Sort keys formats the document and puts every object's keys in UTF-16 code unit order, so "10" comes before "9". Arrays keep their order.

Example

Input: {"b":1,"a":{"d":2,"c":3}}

Sort keys writes:

{
  "a": {
    "c": 3,
    "d": 2
  },
  "b": 1
}

Limits

  • Integers beyond 2^53 lose precision: 12345678901234567890 becomes 12345678901234567000.
  • A repeated key keeps its last value, and each repeat is listed as a warning.
  • Format and Minify move array-index keys such as "9" ahead of other keys, and rewrite numbers and string escapes in canonical form: 1.0 becomes 1 and "\u0041" becomes "A".
  • Output uses LF line breaks and carries no BOM.
  • Input of 256.0 KB or more runs in the background and can be cancelled. Smaller input runs at once and cannot be cancelled.
  • Bounds: input of 16.0 MB, 64 levels of nesting, 200000 keys, output of 16.0 MB, and 30 seconds for a background run.

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.