What is a JSON file?

JSON is a plain text format for structured data: objects with named values, lists, text, numbers, true, false and null. Websites, APIs and apps use it to exchange data. It is strict, so one missing comma or quote makes the whole file unreadable.

Drop your file here

or select file

Images, video, audio, documents, data, archives, fonts and more.

About JSON file:

01JSON at a glance

Full name
JavaScript Object Notation
Type
Plain text for structured data
Extension
.json (.jsonl for JSON Lines)
MIME type
application/json
Defined in
RFC 8259 and ECMA-404
Values
Object, list, text, number, true, false, null

02What is a JSON file

JSON is a plain text format for structured data. An object is a set of named values in curly braces, a list is values in square brackets, and a value can be text, a number, true, false or null. Websites, APIs, apps and settings files use it because every programming language reads it.

It is strict. The format has no comments, keys and text must be in double quotes (single quotes are not allowed), there can be no comma after the last item, and the words true, false and null are lower case. One mistake makes the whole file unreadable, which is why this tool shows the line and column of the first error.

RFC 8259 says that JSON exchanged between systems must be encoded in UTF-8, and that an implementation must not add a byte order mark. Numbers are written as plain digits, but many programs read them as floating point, so a whole number above 9,007,199,254,740,991 can change when it is read. Long IDs are safer as text in quotes.

JSON Lines is a related convention: one JSON value on each line, so a huge list can be read line by line. This tool recognises it. A list of flat objects, where every object has the same simple fields, maps well to a table. Objects inside objects do not.

03Good and bad sides

Good

  • Every language and platform can read and write it
  • Handles nested data that a table cannot
  • Plain text: easy to read, diff and edit
  • The standard way for apps and websites to exchange data

Bad

  • Strict: a missing comma or quote breaks the whole file
  • No comments and no date type
  • Large numbers can lose digits in programs that use floating point
  • Verbose for big tables compared with CSV

04Best for

  • Moving data between apps and websites

    The usual choice. Keep it UTF-8, use double quotes and no trailing commas.

  • Nested data

    Handles nested data that a table cannot.

  • Settings and config files

    Works, but it has no comments, and one missing comma breaks the file. YAML is easier for people to edit.

  • Opening as a spreadsheet

    Works best for a list of flat objects. Convert it to CSV or XLSX first if you have nested data you want as columns.

  • Big tables

    Works, but CSV is much shorter for a flat table.

05How to open it

Any system
A text editor, VS Code, or a browser (many show a formatted tree)
Spreadsheets
Excel (Data, Get Data, From JSON) and Google Sheets with a script or an add-on
Programming
Every language has a JSON parser built in or in its standard library

06Convert and compare

Related formats: CSV, XML, YAML, XLSX

Sources