Processed on this device
File formats at a glance.Formats

JSON file: structure, data types and valid syntax

.json

JSON is a text-based exchange format for structured data. It combines objects, arrays, strings, numbers, booleans and null in a strict language-independent syntax.

Format at a glance

Full name
JavaScript Object Notation
File extensions
.json
MIME types
application/json;charset=utf-8
Category
Text and data
Compression
Depends on the contained codec
Transparency
Not applicable
Animation
Not applicable
Properties

Suitable tools

What is this format?

JSON means JavaScript Object Notation but is not limited to JavaScript. Keys require double quotes; comments and trailing commas are not part of the standard.

Unicode text and a defined grammar make JSON highly interoperable. Systems such as JSON Schema can add rules for content and data types.

What is it used for?

  • Web APIs and application data
  • Configuration and export files
  • Data exchange between programming languages
  • Document-oriented databases

Which programs can open it?

  • Visual Studio Code and JetBrains IDEs
  • Browser developer tools
  • jq and command-line programs
  • Almost every modern programming language

Support across devices and browsers

Windows

JSON opens in text editors and suitable spreadsheet, development or data tools.

macOS

TextEdit, development editors and format-specific applications can read JSON.

Linux

Text editors, command-line tools and programming libraries support JSON.

Android

Text and data editors can open JSON, with varying validation and editing features.

iOS

Files-compatible editors and development tools can display JSON.

Browsers

A browser can show the text, but correct presentation or validation requires a suitable parser.

Advantages

  • Clear and widely used syntax
  • Supports nested objects and arrays
  • Large parser and validator ecosystem

Disadvantages

  • No standard comments
  • Dates and binary data require conventions
  • Very large files can be memory-intensive without streaming

Comparison with alternatives

JSON vs. YAML

YAML is often shorter and supports comments, but has a more complex syntax.

JSON vs. XML

XML offers namespaces and mixed content but is more verbose for typical API data.

JSON vs. CSV

CSV is ideal for flat tables; JSON can store nested records and different types.

LocalFileLab support

InputSupported

JSON is recognized as an input. Text is read locally and handled by the matching parser.

OutputSupported

JSON is available as a local output; available settings depend on the format.

CompressionSupported

LocalFileLab can compress JSON locally or package it in a supported archive; already compressed content will not necessarily become smaller.

PreviewNot supported

A complete JSON preview is not currently available.

MetadataNot supported

Complete preservation of format-specific metadata is not guaranteed.

Related formats

Frequently asked questions

Can JSON contain comments?

The JSON standard does not allow comments. JSON5 and application-specific parsers add them but are not normal JSON.

Why is my JSON invalid?

Common causes include single quotes, trailing commas and unescaped special characters.

Can JSON store binary data?

Not directly. Binary data is commonly represented as Base64 text or an external reference.