File Information Schemas

Newline Delimited JSON

CC-BY-SA
This work is licensed under the Creative Commons Attribution-ShareAlike License 4.0.

Extension(s):
.jsonl, .ndjson.
Media Type(s):
application/jsonl, application/x-ndjson.
Latest Version:
index.shtml

Introduction

Two types of equivalent formats of line-delimited JSON are:

NDJSON makes use of the fact that the JSON format does not allow return and newline characters within primitive values (in strings those must be escaped as “\r” and “\n”, respectively) and that most JSON formatters default to not including any whitespace, including returns and newlines. These features allow the newline character or return and newline character sequence to be used as a delimiter.

In the past the NDJ specification (“newline-delimited JSON”) allowed comments to be embedded if the first two characters of a given line were “//”. This could not be used with standard JSON parsers if comments were included. The current version of the specification (“NDJSON - Newline delimited JSON”) no longer includes comments.

References and Further Reading