JSON Viewer & Formatter

View JSON as a navigable tree, check syntax, and format or minify it while preserving number and string spelling.

Paste your JSON

Drop a JSON file hereor open a file from your device.json or .txt · see Input limits
Examples
Input limits

Up to 2,000,000 UTF-16 units, 100,000 values and 64 levels. Input stays unchanged when you format. Files must also be no larger than 8 MB before reading; the parsed document still has to fit these input limits.

Use the JSON viewer

Paste a document or open a file, then choose View & format JSON to check its syntax. Use Tree to navigate and search values, Formatted to read indented JSON, or Minified for compact output. Open Table for rows and CSV export, or Insights for field statistics, a draft schema and TypeScript types. Copy a result or prepare a download without changing your input.

Inspect an API response

This example keeps the original number spelling and the Unicode text while showing the structure.

Source

{"requestId":9007199254740993,"customer":{"name":"Ada","message":"Hello 👋"},"items":[{"sku":"A-1","price":12.5000,"inStock":true},{"sku":"B-2","price":4.99,"inStock":false}],"next":null}

Formatted

{
  "requestId": 9007199254740993,
  "customer": {
    "name": "Ada",
    "message": "Hello 👋"
  },
  "items": [
    {
      "sku": "A-1",
      "price": 12.5000,
      "inStock": true
    },
    {
      "sku": "B-2",
      "price": 4.99,
      "inStock": false
    }
  ],
  "next": null
}

Check syntax and keep the original text

A trailing comma is invalid JSON. This reader reports the error and leaves the source available to correct; removing the comma makes the array valid:

Syntax error

[1,2,]

Remove the trailing comma.

Corrected JSON

[1,2]

Formatting preserves number spelling such as 12.5000 and the source spelling of string escapes. Exact copy keeps the selected text as written; decoded copy returns a string's value. Duplicate object keys remain visible as separate entries. A JSON Pointer through a duplicate key is ambiguous, so the viewer does not present it as a unique path.

View JSON as a table and export CSV

An array of records can be shown with one row per object and a column for each direct field. This example has a string, a null value and a missing field:

JSON records

[{"id":1,"status":"active"},{"id":2,"status":null},{"id":3}]

CSV export

"id","status"
"1","active"
"2","null"
"3",""
Table preview
idstatus
1"active"
2null
3—

A dash marks a missing field; null is an explicit value. CSV uses an empty cell for a missing field and the text null for null. Nested objects and arrays stay as JSON in their cells. Table opens the first record array inside an object, such as the API response's items; you can select other arrays from the Table source list. Arrays that cannot form record columns use a single Value column, keeping every item.

In Table, choose a Table source and Prepare CSV to export its full rows, including those beyond the preview. Formula-like strings get a leading tab by default. Spreadsheet applications can still reinterpret numbers and other values; CSV does not preserve every JSON type distinction.

Find field statistics and generate JSON Schema or TypeScript

Open Insights to see document size, value counts, depth and a field profile. In the records above, status is present in 2 of 3 objects, missing from 1, and null in 1. Its observed types are string and null.

Inferred JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "integer"
      },
      "status": {
        "type": [
          "string",
          "null"
        ]
      }
    }
  }
}

Generated TypeScript types

export type Root = Array<{
  [key: string]: unknown;
  "id"?: number;
  "status"?: string | null;
}>;

The JSON Schema draft uses version 2020-12. Both outputs describe observed values: fields stay optional, even a field such as id that appears in every record, and extra keys are allowed. They do not infer required fields, business rules, dates, enums or value ranges. Review the draft against real requirements before using it. TypeScript uses number, which cannot represent every JSON number precisely.

Duplicate object keys make inference ambiguous, so statistics remain available but schema and types are not generated. Small documents are analyzed in the background after the tree appears; larger or complex documents may ask you to choose Analyze JSON in Insights. Table data and CSV are prepared when you request them.

Document limits

The reader accepts up to 2,000,000 UTF-16 code units of input, 100,000 JSON values, and 64 nesting levels. A supplementary character such as an emoji uses two UTF-16 code units. Formatted output is capped at 8,000,000 units. Large formatted results can be prepared for download instead of requiring the full result to appear in the preview. Files must also be no larger than 8 MB; the parsed document still has to fit the input limits above. Table previews and field profiles have their own bounds, shown in the result. An export that exceeds its limit is refused rather than silently cut short.

Processing and privacy

JSON parsing, search, formatting, field analysis, schema and type generation, and CSV preparation run in your browser. Viewer action events use fixed names for input start, parse attempts and failures, usable results, copy outcomes and download initiation. They do not include JSON contents, search text, keys, values, file names, or JSON paths.

Questions

When should I format or minify JSON?

Formatted JSON is easier to scan and edit; minified JSON is compact for transfer or embedding.

Does generating a schema validate or repair my JSON?

No. Schema generation produces a starting draft from your sample. Schema validation would check data against an existing schema. This tool checks JSON syntax, but does not validate against a schema or repair errors. Input must be one strict JSON value. Comments, JSON5 syntax and JSONL documents are not supported.

Can I compare two documents here?

Use JSON Compare for two JSON documents. It rejects duplicate keys and has smaller limits: 200,000 UTF-16 units per input and 10,000 values. For plain text, use Text Compare.