JSON Reader

JSON Reader formats and validates JSON objects and arrays. Paste your JSON and press Format: you get it neatly indented with colours, or one clear error with the exact line and column. You can also view the result as a tree. Everything runs entirely in your browser, so your JSON stays on your device.

  • Free
  • No sign-up
  • Works in your browser
  • Nothing is uploaded

Format and validate JSON

Runs in your browser. Your JSON is never uploaded, saved or logged.

0 characters · 0 B

Up to 10 MB. You can also drop a .json file onto the box. Press Ctrl + Enter (⌘ + Enter on a Mac) to format.

The JSON Reader needs JavaScript.

The JSON Reader works inside your browser, so it needs JavaScript. Please enable JavaScript and reload this page, or use a current version of Chrome, Edge, Firefox or Safari.

How to format JSON

This JSON formatter and JSON beautifier pretty prints your data in four steps.

  1. Paste or open your JSON

    Paste JSON into the box, open a .json file or drop one onto the box.

  2. Press Format

    Press Format (or Ctrl + Enter, ⌘ + Enter on a Mac) to pretty print JSON with 2 spaces, 4 spaces or tabs.

  3. Read the result

    Read the coloured result, or switch to Tree to open objects and arrays one level at a time.

  4. Copy or download

    Copy the formatted JSON, or download it as a .json file. Minify gives you the compact form.

Common JSON errors and how to fix them

As a JSON validator, the JSON Reader stops at the first problem and tells you what is wrong, with the line and column. These are the mistakes it finds most often.

Single quotes

JSON strings and keys must use double quotes. Replace each 'text' with "text".

Not valid
{'name': 'Asha'}
Valid JSON
{"name": "Asha"}

Trailing commas

A comma after the last item of an object or array is not allowed. Remove it.

Not valid
[1, 2, 3,]
Valid JSON
[1, 2, 3]

Comments

JSON has no comments. Delete // and /* */ comments, or move the note into a value.

Not valid
{"port": 8080 // default}
Valid JSON
{"port": 8080}

Unquoted keys

Every key needs double quotes, even when it is a single word.

Not valid
{id: 7}
Valid JSON
{"id": 7}

True, False and None

JSON writes these values in lowercase, and None becomes null.

Not valid
{"active": True, "parent": None}
Valid JSON
{"active": true, "parent": null}

Convert a Python dict to JSON

A Python dictionary printed with print() looks like JSON but is not: it uses single quotes, True, False and None, and often has trailing commas. When the JSON Reader finds one of these, a Fix to JSON button appears next to the error. It converts single-quoted strings to double-quoted ones, True to true, False to false and None to null, and removes trailing commas. It works on the structure only and never changes the text inside your strings, so a value such as "True" or "It's" stays as it is. The result is checked and formatted straight away, and Undo fix brings your original text back.

Your JSON stays on your device

JSON often holds API keys, tokens or customer data, so this JSON viewer never sends it anywhere. Your browser reads, checks and formats it on your own computer or phone. Nothing is uploaded, nothing is saved (not even in your browser's storage) and nothing is logged, and files you open are read on your device. Refreshing or closing the page clears everything.

Frequently asked questions

Is the JSON Reader free?

Yes. The JSON Reader is free to use, with no sign-up and no account.

Is my JSON uploaded or saved?

No. Your JSON is read, checked and formatted only in your browser, on your own device. It is never uploaded to our server, never saved and never logged, and refreshing the page clears it.

How do I find the error in my JSON?

Press Format. If the JSON is not valid, the JSON Reader shows one clear message with the line and column of the problem and a marker under the exact position. Press Go to error to jump straight to it in your text.

Can it convert a Python dictionary to JSON?

Yes. When your text uses single quotes, True, False, None or trailing commas, press Fix to JSON. It converts them without changing the text inside your strings, and Undo fix brings your original text back.

Does it change my numbers?

No. Numbers are kept exactly as written, so big integers such as 12345678901234567890 and values such as 1.0 or 1e5 stay unchanged. Strings and their escapes stay as written too.

What is the size limit?

10 MB of JSON. The work happens in your browser, so the limit keeps the page fast and your device's memory use reasonable.

Can I view JSON as a tree?

Yes. Switch the result to Tree to open and close objects and arrays, with the key, type and number of items of each one. It works with the mouse and with the keyboard.

Questions about this tool? Contact us.