JSON Formatter

  • Tested against RFC 8259 and 900 cases checked with Python's json module
  • Checked by Wayne Bickerton
  • Sources: RFC 8259
  • Updated November 12, 2026

Paste JavaScript Object Notation (JSON), the text format apps and websites use to pass data around, to make it readable: each name and value on its own line, indented by level. It also checks the JSON as you type and, if something is wrong, says where (line and column) and how to fix it. Everything happens on your device: nothing you paste is sent anywhere or put in the page’s link.

Formatted on your device. What you paste is never sent anywhere or put in the link.

Formatted JSON
{ "Image": { "Width": 800, "Height": 600, "Title": "View from 15th Floor", "Thumbnail": { "Url": "http://www.example.com/image/481989943", "Height": 125, "Width": 100 }, "Animated": false, "IDs": [ 116, 943, 234, 38793 ] } } Valid JSON

Valid JSON: an object with 1 name, nested 3 levels deep.

Lines 19
Size 302 bytes
Deepest level 3

How to format JSON

JSON is made of names and values inside { } (objects) and [ ] (lists, called arrays). Spaces, tabs and line breaks between those parts mean nothing to a computer, so a formatter can add them for people: each item goes on its own line, one indent step deeper for every bracket it sits inside. Minifying takes them all out again to make the file smaller.

Each name and value on its own line, indented one step for every { or [ it sits inside

Here it is with your numbers:

  1. Checked all 196 characters against the JSON grammar (RFC 8259): no errors.
  2. Put each name and value on its own line, indented 2 spaces for each level, with a colon and a space after each name.
  3. Copied every number and piece of text exactly as typed, so the data is unchanged.

It means your JSON is valid and now 19 lines long.

The example is the sample from the JSON standard itself. This formatter copies every number and piece of text exactly as you typed it, so 12345678901234567890 stays as it is; tools that read JSON into JavaScript numbers can change numbers that long.

Source RFC 8259 · The JSON Data Interchange Format, §2 JSON Grammar ↗RFC 8259 · §6 Numbers ↗

What is JavaScript Object Notation (JSON)?

JSON is a way of writing data as text that almost every programming language can read. A JSON value is one of six things:

KindLooks like
Object (names and values){"name": "Ann", "age": 34}
Array (a list)[116, 943, 234]
String (text)"View from 15th Floor"
Number800, -2.5, 1e6
True or falsetrue, false
Nothingnull

Names in an object should be unique: programs disagree on what a repeated name means (many keep only the last), so this page points them out.

Source RFC 8259 · §3 Values ↗RFC 8259 · §4 Objects ↗

Common JSON errors and how to fix them

MistakeNot validValid
Comma after the last item[1, 2, 3,][1, 2, 3]
Single quotes{'name': 'Ann'}{"name": "Ann"}
Name without quotes{name: "Ann"}{"name": "Ann"}
A comment{"a": 1} // note{"a": 1}
Capital True or None[True, None][true, null]
Leading zero{"zip": 02134}{"zip": "02134"}

Text in quotes also can’t hold a real line break or tab: write \n and \t instead. JavaScript accepts some of these mistakes; JSON doesn’t, and the first one found stops the check.

Source RFC 8259 · §7 Strings ↗

FAQs

What is a JSON file format?

A JSON file is plain text holding JSON data, usually with the .json extension (the official media type is application/json). Shared JSON must be written in UTF-8.

Source RFC 8259 · §11 IANA Considerations (media type and .json) ↗

How do I open a JSON file?

It is plain text, so any text editor opens it (Notepad, TextEdit, VS Code). To read it easily, copy the text into the box above and it is laid out with one item per line.

Source RFC 8259 · §8.1 Character Encoding ↗

How do you make a JSON file readable?

Format it: put each name and value on its own line and indent each level. Spaces and line breaks between the parts don’t change the data, so formatting is always safe.

Source RFC 8259 · The JSON Data Interchange Format, §2 JSON Grammar ↗

How do I format JSON correctly?

Put names and text in double quotes, separate items with commas (none after the last), write true, false and null in lowercase, and leave out comments. Numbers have no leading zeros.

Source RFC 8259 · §3 Values ↗

How do I validate JSON?

Check it against the JSON grammar. Paste it above: the first error is shown with its line and column and a fix, and valid JSON is marked “Valid JSON”.

Source RFC 8259 · §9 Parsers ↗

Sources

Related calculators