JSON Formatter

Paste JSON to beautify and validate it as you type. Errors point to their exact line, and a tree view lets you explore the data.

Output
FormatMinifyEscape

Indented, easy to read

Indent
2 spaces4 spacesTab

Spaces or a tab per level

Your JSON

Paste JSON, drop a file or open one to start.

Your formatted JSON shows here as you type, ready to copy or download.

Format JSON online with 2 spaces, 4 spaces or tabs, or minify it to one line for an API call or a config value.

Free with no sign-up, no save links and no cap on how often you format, check or fix your JSON.

  • Errors shown on their line, with a fix
  • Tree view with the path of every value
  • Large numbers kept digit for digit

How to format JSON online

Beautify, check and minify JSON in three steps.

  1. Paste JSON to format

    Paste JSON into the left box, drop a .json file on it or press Open file. The formatted copy appears on the right.

  2. Fix any JSON errors

    Invalid JSON gets a red note with its line and column. Press Fix to clear comments, stray commas and quotes.

  3. Copy, save or minify

    Pick 2 spaces, 4 spaces or tabs, or Minify for a single line. Then copy the result or download it as a .json file.

Check JSON online and find errors

The validator follows the JSON standard, RFC 8259, the same rules that JSON.parse, Python and most APIs apply. When a character breaks them, you get a plain message such as "Missing comma between items", and its line lights up in the input.

Most invalid JSON comes from a few habits: a comma after the last item, single quotes, keys without quotes, // comments copied from a config file, or True and None pasted from Python. Fix rewrites all of these into valid JSON at once and says what it changed.

Numbers stay exactly as you typed them. Many formatters round long IDs such as 12345678901234567890, because JavaScript keeps numbers in 64 bits; here every digit is kept, and a key that appears twice in one object is flagged instead of silently dropped.

A JSON viewer with a tree view

A long API response is hard to read even when indented. The Tree tab shows the same data as branches you open and close, with the number of keys in each object and items in each array, so a 5,000 line response reads as a short outline.

Click any key or value to see its path, such as $.orders[3].items[0].price, and copy it into JavaScript, Python or a JSONPath query. Expand all and Collapse all jump between the whole document and its top level.

What this JSON beautifier does

  • JSON tree viewer

    Open and close objects and arrays, see the size of each, and expand or collapse all levels at once.

  • JSON path finder

    Click a key or value in the tree to get its full path, ready to copy into code or a JSONPath query.

  • Minify JSON

    Strip every space and line break to send JSON as one line. The bytes saved show beside the result.

  • Escape and unescape

    Turn JSON into one escaped string for code, or unpack an escaped string from a log back into JSON.

  • Sort keys A to Z

    Put the keys of every object in A to Z order, at all levels, so two versions are easier to compare.

  • Large JSON files

    Open .json files up to 50 MB. Big files are read in a background thread, so the page never freezes.

Is it safe to format JSON online?

Here, yes. Your JSON is formatted in this tab and is never sent, saved to a link or shared.

  • Processing

    Parsing, checking and formatting run in your browser. Your JSON, keys and tokens never go online.

  • Storage

    Your input is kept in this browser only, so a refresh keeps it. No save link exists to be found.

  • Account

    A free JSON formatter with no sign-up, no email and no usage cap. Nothing about your data is kept.

Questions about JSON

What is JSON and what is it used for?

JSON, short for JavaScript Object Notation, is a plain text format for data. Apps and APIs use it to send keys and values.

What is a JSON file?

A text file ending in .json that holds JSON data, such as app settings, an export or an API response. Any text editor opens it.

How do I open a JSON file?

Drop it on the box above to read it formatted, or as a tree. Notepad, TextEdit and VS Code open it too, as plain text.

Can JSON have comments?

No. Standard JSON has no comments, though JSONC files such as VS Code settings allow them. Fix removes them for you.

How do I check if JSON is valid?

Paste it above. A green note means it is valid; a red one names the line, the column and what is wrong at that spot.

How do I pretty print JSON?

Paste it here, or in code call JSON.stringify(data, null, 2) in JavaScript or json.dumps(data, indent=2) in Python.

How do I format JSON in VS Code?

Press Shift+Alt+F on Windows, Shift+Option+F on a Mac or Ctrl+Shift+I on Linux. It runs Format Document on the file.

Is JSON case sensitive?

Yes. Name and name are two different keys, and true, false and null must be lowercase: TRUE or Null makes JSON invalid.

Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.