JSON To JSONLines

Login

Email
Password

Don't have an account yet?

Go to Sign up

Input Data
Sample {{ showCoderInput ? 'Choose File' : 'Enter Data' }}

                                
Valid JSON Invalid JSON — Cannot convert to JSON Array
Output Data
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert JSON to JSONLines online — paste, edit, and download JSONLines.

Parse JSON:
Intelligently parse JSON strings in cells into objects.
Data Format:
Choose the format of each JSONLine entry.
Convert Restart

JSON to JSONLines — Free Online JSONL / NDJSON Converter

What Is JSONLines?

JSONLines (also called JSONL, NDJSON, or Newline-Delimited JSON) is a text format where each line contains a single valid JSON value. There is no wrapping array or outer structure.

{"name": "Alice", "age": 30}
{"name": "Bob", "age": 25}
{"name": "Charlie", "age": 35}

The format is defined at jsonlines.org and is sometimes referred to as:

NameAbbreviationContext
JSON LinesJSONLGeneral
Newline-Delimited JSONNDJSONStreaming / logs
Line-Delimited JSONLDJSONData pipelines

JSON vs. JSONLines

FeatureJSONJSONLines
StructureSingle complete document (array or object)One JSON value per line
Wrapper[...] array brackets requiredNo wrapper
SeparatorCommas between elementsNewlines between entries
Trailing commaNot allowedNo commas at all
ParsingMust read entire document firstLine-by-line (streaming)
AppendMust modify array structureAppend a new line
File sizeSlightly larger (brackets, commas)Slightly smaller
Error isolationOne error breaks entire documentOnly the affected line is invalid
EncodingUTF-8UTF-8
MIME typeapplication/jsonapplication/jsonl or application/x-ndjson
File extension.json.jsonl or .ndjson

Why Convert JSON to JSONLines?

Use CaseDescription
BigQuery importGoogle BigQuery loads JSONL files natively via bq load
Elasticsearch bulk APIBulk indexing requires NDJSON format (action line + data line pairs)
Snowflake loadingCOPY INTO supports JSONL natively
Log filesAppend-only log entries — each line is independent
StreamingProcess data line-by-line without loading entire file into memory
Hugging Face datasetsML datasets commonly distributed as .jsonl files
Apache SparkSpark reads JSONL natively with spark.read.json()
Data pipelinesKafka, Fluentd, Logstash use NDJSON for event transport
Append-friendly storageAppend new records without rewriting the entire file
Error resilienceCorrupted lines don't prevent processing of other lines

Platforms That Consume JSONLines

PlatformHow JSONL Is Used
Google BigQuerybq load --source_format=NEWLINE_DELIMITED_JSON
Elasticsearch_bulk API requires NDJSON
SnowflakeCOPY INTO with FILE_FORMAT = (TYPE = JSON)
Amazon RedshiftCOPY with JSON 'auto' from JSONL files
Apache Sparkspark.read.json("data.jsonl")
Hugging FaceDatasets in .jsonl format
OpenAI Fine-tuningTraining data submitted as .jsonl
LogstashNDJSON input plugin
MongoDBmongoimport with --type json reads JSONL
PostgreSQL\copy or COPY with JSONL via extensions
AWS Kinesis FirehoseNDJSON delivery to S3
Datadog LogsLog entries in JSONL format

Core Features

1. Dual Input Modes

  • File Upload: Drag and drop or select a .json file.

  • Code Editor: Paste or type raw JSON with syntax highlighting and real-time validation.

2. Parse JSON

Description: Intelligently parse JSON strings embedded in cells into structured objects.

When enabled, the tool detects string values that contain valid JSON and parses them into proper JSON objects before converting to JSONL.

Example — Parse JSON disabled:

{"id": 1, "data": "{\"x\": 10, \"y\": 20}"}

Example — Parse JSON enabled:

{"id": 1, "data": {"x": 10, "y": 20}}

Use this when your source JSON contains escaped JSON strings (common in database exports, API responses that serialize nested objects as strings, or log aggregation pipelines).

3. Data Format

Choose the format of each JSONLine entry. Controls how the output is structured per line.

4. Privacy by Design

All processing runs entirely in your browser. No data is uploaded to any server.

How to Use This JSON to JSONLines Converter?

Step 1: Provide Your JSON Data

Choose one of two input methods:

  • Upload a file: Click "Choose File" and select a .json file, or drag it into the upload area.

  • Paste data: Click "Enter Data" to switch to the code editor. Paste your JSON array. A "Valid JSON" badge confirms correct formatting.

Important: The tool expects a JSON array. Each array element becomes one line in the output.

Step 2: Configure Options

Use the Properties panel on the right:

  1. Parse JSON: Enable to parse embedded JSON strings into objects.

  2. Data Format: Choose the output format for each line.

Step 3: Convert

Click Convert. The JSONLines output appears in the "Output Data" panel.

Step 4: Copy or Download

  • Click Copy to Clipboard to paste into a .jsonl file.

  • Premium users can click Download File to save.

Complete Example

Example — Sample

Input JSON:

[
   {"name": "Alice", "age": 30, "city": "New York"},
   {"name": "Bob", "age": 25, "city": "London"},
   {"name": "Charlie", "age": 35, "city": "Tokyo"}
]

Configuration:

  • Parse JSON: Off

  • Data Format: (default)

Output:

{"name": "Alice", "age": 30, "city": "New York"}
{"name": "Bob", "age": 25, "city": "London"}
{"name": "Charlie", "age": 35, "city": "Tokyo"}

Example — Nested JSON Strings

Input JSON:

[
   {"id": 1, "payload": "{\"temperature\": 23.5, \"unit\": \"celsius\"}"},
   {"id": 2, "payload": "{\"temperature\": 19.8, \"unit\": \"celsius\"}"}
]

Configuration:

  • Parse JSON: On

Output:

{"id": 1, "payload": {"temperature": 23.5, "unit": "celsius"}}
{"id": 2, "payload": {"temperature": 19.8, "unit": "celsius"}}

Example — BigQuery Import

Input JSON:

[
   {"order_id": "ORD-001", "total": 149.99, "items": 3, "status": "shipped"},
   {"order_id": "ORD-002", "total": 59.50, "items": 1, "status": "pending"},
   {"order_id": "ORD-003", "total": 224.00, "items": 5, "status": "shipped"}
]

Output (saved as orders.jsonl):

{"order_id": "ORD-001", "total": 149.99, "items": 3, "status": "shipped"}
{"order_id": "ORD-002", "total": 59.50, "items": 1, "status": "pending"}
{"order_id": "ORD-003", "total": 224.00, "items": 5, "status": "shipped"}

BigQuery load command:

bq load --source_format=NEWLINE_DELIMITED_JSON \my_dataset.orders \gs://my-bucket/orders.jsonl

Example — Elasticsearch Bulk API

Output (with action metadata lines):

{"index": {"_index": "users", "_id": "1"}}
{"name": "Alice", "age": 30, "city": "New York"}
{"index": {"_index": "users", "_id": "2"}}
{"name": "Bob", "age": 25, "city": "London"}

Elasticsearch _bulk API requires alternating action and data lines in NDJSON format.

Example — OpenAI Fine-tuning

{
   "messages": [
       {"role": "system", "content": "You are a helpful assistant."},
       {"role": "user", "content": "What is 2+2?"},
       {"role": "assistant", "content": "4"}
   ]
}
{
   "messages": [
       {"role": "system", "content": "You are a helpful assistant."},
       {"role": "user", "content": "Capital of France?"},
       {"role": "assistant", "content": "Paris"}
   ]
}

OpenAI fine-tuning data must be submitted as a .jsonl file.

JSONLines Specification Summary

From jsonlines.org:

  1. UTF-8 encoding — each file must be valid UTF-8

  2. One JSON value per line — each line is a complete, valid JSON value

  3. Line separator\n (0x0A) — \r\n is also accepted

  4. No trailing comma — each line ends at } or ]

  5. No blank lines — every line must contain a JSON value (except the final newline)

Frequently Asked Questions (FAQ)

  • Does the tool upload my data?

    No. All conversion happens locally in your browser using JavaScript. Your data never leaves your device.

  • What is JSONLines?

    JSONLines (JSONL / NDJSON) is a format where each line of a file contains a separate, valid JSON object. There is no wrapping array. It is used for streaming, log files, and bulk data imports.

  • What is the difference between JSON and JSONLines?

    JSON wraps multiple records in a [...] array with comma separators. JSONLines puts each record on its own line with no commas or brackets. JSONLines supports line-by-line processing, appending, and error isolation.

  • What does "Parse JSON" do?

    It detects string values in your JSON data that contain embedded JSON (e.g., "{\"x\": 1}") and parses them into proper JSON objects (e.g., {"x": 1}). Enable this when your source data has escaped JSON strings inside string fields.

  • What platforms accept JSONLines files?

    BigQuery, Elasticsearch, Snowflake, Redshift, Apache Spark, MongoDB, Hugging Face, OpenAI (fine-tuning), Logstash, and many more.

  • What file extension should I use?

    Use .jsonl or .ndjson. Both are widely recognized. BigQuery documentation uses .jsonl. Elasticsearch documentation uses .ndjson.

  • Is there a file size limit?

    The tool processes data entirely in your browser. Files up to 10 MB typically convert without issues on modern hardware.

  • Can I use this on mobile?

    Yes. The tool is responsive and works on smartphones and tablets.

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Free online JSON to CSV converter. Paste or upload JSON data and get formatted CSV instantly — no upload, 100% private. Supports custom delimiters, UTF-8 BOM, and JSON code editor.

JSON To CSV

Free online JSON to CSV converter. Paste or upload JSON data and get formatted CSV instantly — no upload, 100% private. Supports custom delimiters, UTF-8 BOM, and JSON code editor.
Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.

Excel To JSON

Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.
Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.

Excel To CSV

Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.
Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.

Excel To SQL

Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.