JSON Formatter & Validator

Format, minify and validate JSON. View code or explore a tree.

Your JSON stays in your browser

Input JSON

Result

Your JSON will appear here

Add your data and choose an action.

Ready when you are
Ctrl / ⌘ + Enter to format

How to format and validate JSON

  1. 1

    Add your JSON

    Paste text, upload a .json file, or drop it into the editor. Files can be up to 10 MB.

  2. 2

    Choose an action

    Format with 2 or 4 spaces, remove unnecessary whitespace, or check the syntax.

  3. 3

    Explore the result

    Switch to tree view and find a key or value. Copy the result or download a JSON file.

JSON examples

Valid JSON
{
  "name": "JSONLab",
  "languages": ["ru", "uz", "en"],
  "free": true
}
Error: trailing comma
{
  "name": "JSONLab",
  "free": true,
}
Large number, no rounding
{
  "id": 9007199254740993,
  "precise": 0.1234567890123456789,
  "large": 1e400
}

Use double quotes for keys and strings. Comments and commas after the last item are not allowed.

Frequently asked questions

What does the JSON Formatter do?

It adds line breaks and indentation to make JSON easier to read. Minification removes whitespace only outside strings. Keys, values and their order are preserved.

How does the Validator show errors?

It checks syntax and reports the cause, line and column. The Go to error button selects the problem in your input. Columns are counted in UTF-16 code units.

Is my JSON sent to a server?

No. Text, uploaded files, formatting and search are processed in your browser. The service does not store JSON content or use third-party analytics. Only your theme preference is saved.

Are large numbers preserved?

Yes. Numbers are never converted to the JavaScript Number type. Values such as 9007199254740993, long decimals, 1e400 and negative zero keep their original representation.

Which files are supported?

UTF-8 .json files up to 10 MB (10 × 1024 × 1024 bytes). A leading BOM is accepted and removed from the result. A root value can also be an array, string, number, true, false or null.

Are comments and duplicate keys supported?

Comments, single-quoted strings and trailing commas are not part of JSON syntax and trigger an error. Duplicate keys are preserved, but are best avoided: different applications may interpret the same object differently.

Copy result

Automatic copying was unavailable. Select the text below and copy it.