toolulu Easy · Ready · Everywhere

Your connection

…

Local time
—
Time zone
—
Reverse DNS
—
System
—
Browser
—
LogligentMonitoring & Security Intelligence Understand what your
servers are telling youAlready been hacked? Yes? No? Don't know?
Logligent detects and responds.
Sign up free

Run it. Get results.

JSON Formatter and Validator

Free
Format, validate and minify JSON: mistakes shown with their line and column in plain words, keys sorted, a tree view. Free, in your browser.
tooluluEasy · Ready · Everywhere

Use your phone as the camera

Scan this code with your phone's camera, then take a photo of the text. Its words appear here, ready to translate.

Waiting for your phone…

The code works for 15 minutes, for up to 10 photos. Photos are read, then thrown away.

Popular

Pick your tool

toolulu Easy · Ready · Everywhere

156 tools

Open this tool?

About the JSON Formatter and Validator

A free JSON formatter and validator: paste JSON or open a .json file and it is checked as you type. A mistake is shown with its line and column and a plain-words reason (a trailing comma, single quotes, a missing comma, a comment). Format it with 2 or 4 spaces or tabs, minify it, sort the keys A to Z, browse it as a tree with each value's path, then copy or download it. Everything stays in your browser.

How to use it

  1. Paste your JSON, or press "Open file" (up to 10 MB).
  2. Read the check: "Valid JSON", or the line, column and reason of the mistake.
  3. Press Format or Minify, switch to Tree if you like, then Copy or Download.

Questions

Why is my JSON invalid?

The usual causes: a comma after the last item, 'single quotes' instead of "double quotes", a missing comma between items, comments, or True/None from Python. The message says which, and where.

What is the difference between format and minify?

Format adds line breaks and indents so people can read it; minify removes all spaces so it is smallest for sending.

Can JSON have comments?

No: standard JSON has no comments. Remove them, or keep notes in a key such as "_comment".

Is my JSON sent to a server?

No: it is checked and formatted in your browser, so API keys and data stay on your device. Still, avoid sharing JSON that holds passwords.

How big a file can I open?

Up to 10 MB here; the desktop version opens files of any size.

What does the tree view show?

Each object and array as a list you can open and close, with how many items it holds; click a value to see its path, such as $.items[0].name.

Did you know?

{ }: 2001

Discovered, not invented

Douglas Crockford says he didn't invent JSON but discovered it, in the spring of 2001.

Source: Douglas Crockford

Netscape: 1996

Netscape, 1996

The earliest use Crockford knows of JavaScript literals for data transport was by Slava Galperin at Netscape, in June 1996.

Source: Douglas Crockford

application/json: 2006

application/json

RFC 4627, written by Douglas Crockford in July 2006, made "application/json" the media type for JSON.

Source: IETF (RFC 4627)

ECMA-404: 2013

ECMA-404

Ecma International published JSON as the standard ECMA-404, 1st edition in October 2013; it is also ISO/IEC 21778.

Source: Ecma International

UTF-8

UTF-8 between systems

RFC 8259 (2017) requires JSON exchanged between systems that aren't part of a closed ecosystem to be encoded in UTF-8.

Source: IETF (RFC 8259)

Tips for JSON

  1. Double quotes only

    Keys and text need "double quotes", never 'single'.

  2. No trailing comma

    No comma after the last item.

  3. No comments

    JSON has no comments: remove // and /* */.

  4. Lowercase literals

    true, false and null, in lowercase.

  5. Minify to send

    Minify before sending: smaller and faster.

  6. Sort to compare

    Sort keys to compare two JSON files more easily.

  7. Read the line

    The line and column point right at the mistake.

  8. Keep secrets out

    Don't share JSON with passwords or API keys in it.

Advertisements

tooluluEasy · Ready · Everywhere

Advertisements

AcesFive