AppAdd

JSON Formatter

Validate, beautify or minify JSON and see exactly where it is invalid. Strict RFC 8259 JSON only.

Processed in your browser. Nothing you enter is uploaded.

Strict JSON (RFC 8259) only: comments, trailing commas, single quotes and unquoted keys are reported as errors, not repaired.

How to use it

  1. Paste your JSON.
  2. Choose Format or Minify and, for formatting, the indentation.
  3. Fix any error shown with its line and column.
  4. Copy the result or download it as a .json file.

Example

Minify
Input:{ "a": 1, "b": [1, 2] }
Result:{"a":1,"b":[1,2]}

What does JSON Formatter do?

JSON Formatter validates, beautifies or minifies JSON and reports the line and column of any error.

How does JSON Formatter work?

A strict scanner finds and describes errors, and the browser's native JSON.parse and JSON.stringify produce the output. Everything runs in your browser.

Is my data uploaded?

No. Your JSON is processed in your browser and is never sent anywhere.

Which formats and inputs does JSON Formatter support?

Inputs: Strict JSON text (RFC 8259). Output: Formatted JSON with 2 spaces, 4 spaces or tabs, minified JSON, or an error with its position.

What are the limits and limitations of JSON Formatter?

Limits: maximum input 10,000,000 characters; tested with about 1 MB of JSON. Comments, trailing commas, single quotes and unquoted keys are errors, not repaired. Numbers that a JavaScript number cannot hold exactly trigger a precision warning.

More questions

Does it accept comments or trailing commas?

No. The input must be strict JSON, and anything else is reported as an error with its line and column.