Format, validate, inspect

JSON Formatter

Format, validate and inspect JSON data directly in your browser. Beautify messy JSON, check its structure, find errors and understand the JSON format without uploading your data.

Private by default

Free · No signup · JSON stays in your browser

Examples

Paste JSON or choose an example to begin.

⌂ Everything stays in this browser.

Result

Formatted JSON

{
  "name": "Alex",
  "active": true,
  "roles": [
    "developer",
    "admin"
  ]
}
JSON Example

JSON Example

This example is an object with one user. Keys name pieces of data, while values can be strings, numbers, booleans, arrays or nested objects. Load it to see the same data in the formatter, tree view and X-Ray summary.

{
  "user": {
    "id": 1042,
    "name": "Alex",
    "active": true,
    "roles": ["developer", "admin"],
    "profile": {
      "country": "US",
      "timezone": "America/New_York"
    }
  }
}
What Is JSON?

What Is JSON?

JSON is a lightweight, text-based format for structured data. People and programs use it to exchange information because it is readable, broadly supported and independent of a particular database or programming language. APIs often return JSON; apps also use it for settings, exports and configuration.

What Is JSON Data?

What Is JSON Data?

A JSON document contains one root value. In practice that root is usually an object or array. Objects group named fields; arrays keep an ordered list. Each field or item uses one of the JSON value types below.

ObjectNamed properties between { }
ArrayOrdered items between [ ]
StringText in double quotes
NumberA finite numeric value
Booleantrue or false
NullThe literal null value
What Is the JSON Format?

What Is the JSON Format?

JSON has a small set of strict rules. Small punctuation mistakes can make an API response or configuration file invalid, so a formatter is useful before you share or save a document.

  1. Use double quotes for every key and string.
  2. Wrap objects with { } and arrays with [ ].
  3. Separate object properties and array items with commas.
  4. Do not leave a comma after the final item.
  5. Put one colon between an object key and its value.
  6. Use true, false and null in lowercase.
  7. Numbers cannot include leading plus signs or NaN.
  8. Escape a quote inside a string with a backslash.
  9. Do not add comments; standard JSON has no comment syntax.
  10. Keep every opening brace and bracket matched with a closing one.
Common broken input
{
  name: 'Alex',
  active: True,
}
After common repair
{
  "name": "Alex",
  "active": true
}
Valid JSON
What Is JSON Schema?

What Is JSON Schema?

JSON Schema is a separate standard for describing expected JSON structure: required fields, permitted value types, formats and more. JSON is the data; a schema is a contract for that data. This tool currently validates JSON syntax and helps inspect its shape. It does not claim to validate a JSON Schema.

Common JSON Errors

Common JSON Errors

The repair action handles a limited, predictable set of copy-and-paste mistakes: comments, simple unquoted keys, single-quoted strings, Python-style True/False/None and trailing commas. Review repaired output before using it in production.

FAQ

JSON Formatter FAQ

What is JSON?

JSON, short for JavaScript Object Notation, is a text format for structured data. It is widely used by APIs, configuration files and web applications.

What is a JSON file?

A JSON file is a plain-text file, usually ending in .json, containing JSON data. It can be opened in a code editor or processed by software that supports JSON.

What is JSON data?

JSON data combines objects, arrays, strings, numbers, booleans and null into a structured value that software can exchange and read.

What is JSON format?

JSON format means its syntax rules: double-quoted keys and strings, commas between items, colons between keys and values, and matched braces or brackets.

Can I see a JSON example?

Yes. Use the example on this page or select a sample in the workspace. The example button loads it into the formatter locally.

What is JSON Schema?

JSON Schema is a separate specification used to describe rules for JSON data, such as required fields and allowed types. It is not the same as JSON syntax.

What is the difference between JSON and JSON Schema?

JSON is the data itself. JSON Schema describes what shape that data should follow. A valid JSON document can still fail a separate schema’s business rules.

Does formatting JSON validate it?

Formatting first checks whether JSON syntax is valid. It does not validate a document against a JSON Schema or an API’s required fields.

Does formatting change the data?

No. Formatting changes only whitespace around valid JSON. ToolkitLoop preserves the original numeric text during formatting instead of reserializing it through JavaScript numbers.

Is JSON the same as a JavaScript object?

No. JSON is text with strict syntax. JavaScript objects are runtime values and can contain functions, undefined values and single quotes, which JSON does not allow.