All guides / Developer tools

Developer tools

How to validate and format JSON

JSON is a common text format for API responses, configuration files and data exchange. Validating JSON helps distinguish a syntax error from a problem with the data itself. Formatting makes nested objects and arrays easier to inspect.

Start with valid JSON

{"orderId":"A102","quantity":5,"active":true,"tags":["new","stock"]}

A valid JSON document can contain objects, arrays, strings, numbers, booleans or null. Object keys must be double-quoted strings. Unlike JavaScript object literals, JSON does not allow comments or trailing commas.

Format or validate the input

  1. Open the JSON Formatter and paste your JSON into the input.
  2. Select a readable indentation or compact output.
  3. Review any validation error and correct the original input.
  4. Copy or download the formatted result when valid.

Common mistakes

InvalidValid
{name:"Ada"}{"name":"Ada"}
[1,2,][1,2]
{"ok":True}{"ok":true}

Watch out for large numeric identifiers

JavaScript cannot represent every integer above 9,007,199,254,740,991 exactly. TheFileMansion rejects unsafe integer values to help prevent silent rounding. If a number is really an identifier and the receiving system permits it, represent it as a quoted string instead.

Validation is not schema checking

Syntax validation does not prove that the document matches an API contract. A field named quantity might be valid JSON but still violate the API schema if it contains a string instead of a number. Check the relevant schema separately. Do not paste credentials or live API tokens into examples you intend to share.

Try it yourself. Free, local browser processing. No account required.

Open JSON Formatter