JavaScript Object Notation

JSON

JavaScript Object Notation is the default interchange format of the web: nested, self-describing, and readable by a human at a glance. It is also verbose, and it is not a table.

Type information
Strings, numbers, booleans, null
Structure
Nested objects and arrays
Compression
None
Typical file size
Largest — keys repeat on every record
Schema
Implicit, per record
Human-readable
Yes, though verbose
Tool support
Every language, natively

JSONParquet

Runs on your device
Options

Reading JSON

Writing Parquet

Parquet is unreadable in a text editor. That is by design.Check your new Parquet file with ParquetReader — opens Parquet files directly.

JSON has six types — string, number, boolean, null, object and array — and no more. There is no date type, no integer-versus-float distinction, and no decimal. Everything numeric is a 64-bit float, which is why identifiers longer than about fifteen digits silently lose precision in most JSON tooling. Dates travel as ISO-8601 strings by convention, not by specification.

The nesting is the point and the problem. It maps perfectly onto application objects, which is why every API speaks it, and badly onto rows and columns, which is why converting to a tabular format requires deciding what to do with nested objects and arrays. Flattening nested objects into dotted columns is the usual answer; arrays have no good tabular answer at all, so they tend to be kept as text.

For anything large, plain JSON is the wrong shape: the whole document must be parsed before the first record is available. JSON Lines exists precisely to fix that.

What JSON is good at

  • Native support in every mainstream language.
  • Represents nested structures without any extra convention.
  • Self-describing — field names travel with the data.
  • Human-readable and diff-friendly when formatted.

Where it falls short

  • Verbose: every key is repeated on every record.
  • No date, decimal or integer types.
  • Numbers beyond 2^53 lose precision in most parsers.
  • Must be parsed in full before any record can be used.
FAQ

JSON questions

What is the difference between JSON and JSONL?
JSON is one document, usually an array of records, that must be parsed as a whole. JSONL is one independent JSON object per line, which can be streamed, appended to, and processed a line at a time.
How is nested JSON converted to a table?
Nested objects become dotted columns — {"user":{"id":7}} becomes a user.id column. Arrays are kept as JSON text, because expanding them would change either the row count or the column count.
Why did my large ID change?
JSON numbers are 64-bit floats, so integers above 2^53 are rounded by most parsers. Converting such values to strings preserves them exactly, which is what this converter does when writing JSON.

Other format guides: CSV · Parquet · JSONL · Excel · TSV