ToolFeather
Developer / SEORuns in your browser

JSON to JSON Lines (JSONL) Converter

Convert a JSON array into JSON Lines: each element is written compactly on its own line — the format BigQuery, Elasticsearch, Spark, log pipelines and fine-tuning APIs expect.

Quick presets

JSON to JSONL

JSON
JSON Lines

Runs in your browser — nothing you enter is uploaded or stored.

ToolFeather · JSON → JSONL
Scratchpad auto-saved
Stored in this browser (localStorage)
Step-by-step~40s read

How it works — in four simple steps

No signup and nothing to install — it all runs in your browser.

1

Add your JSON

Paste it into the left box, press Open file, or drag a .json file onto it. Sample loads a realistic example.

2

Set the options

Adjust the options above the boxes — the output updates instantly as you change them.

3

Check the result

Read the status line: it reports rows, keys and any value that couldn't be represented in JSON Lines.

4

Copy or download

Copy the JSON Lines or download it as a .jsonl file. Nothing was uploaded at any point.

Pro tip

Wrapped in {"data": [...]}? Paste only the inner array so each record gets its own line.

Features

Private by design

Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.

About the JSON to JSONL

JSON Lines is the streaming-friendly cousin of JSON: instead of one big array, every record sits on its own line as compact JSON. Loaders can read it in parallel and append to it without rewriting the file. BigQuery's "newline-delimited JSON" source format, Elasticsearch's _bulk body, Spark's and pandas' lines=True readers, and LLM fine-tuning uploads all use it.

The converter parses your JSON (with line-and-column error messages if it's invalid) and writes each element of a top-level array as one line of minified JSON, in order, with a final newline. Whitespace inside values is preserved exactly; only the formatting between tokens is removed. If the top level is an object or a single value rather than an array, it's written as one line.

Download saves a .jsonl file. Unicode characters are written as-is (UTF-8), not as \u escapes, which keeps files readable and smaller.

Examples

Two chat examples prepared as an array — each becomes one line of a fine-tuning file.

JSON input
[
  {
    "messages": [
      { "role": "user", "content": "Convert 2 km to miles" },
      { "role": "assistant", "content": "2 km ≈ 1.243 miles." }
    ]
  },
  {
    "messages": [
      { "role": "user", "content": "What is 15% of 240?" },
      { "role": "assistant", "content": "15% of 240 is 36." }
    ]
  }
]
JSON Lines output
{"messages":[{"role":"user","content":"Convert 2 km to miles"},{"role":"assistant","content":"2 km ≈ 1.243 miles."}]}
{"messages":[{"role":"user","content":"What is 15% of 240?"},{"role":"assistant","content":"15% of 240 is 36."}]}

This output was produced by the converter on this page with the default options — load it with the “Fine-tuning set” preset above and change any option to see the effect.

How JSON maps to JSON Lines

In JSONBecomes in JSON Lines
[ {…}, {…} ]two lines, one object each
Pretty-printed elementminified onto one line
Nested arrays/objects in an elementkept inside that line
Top-level objecta single line
"é", emojiwritten as UTF-8 characters
End of outputa trailing newline

Things that trip people up

JSON vs JSON Lines at a glance

PropertyJSONJSON Lines
SpecificationRFC 8259 (2017) · ECMA-404jsonlines.org · NDJSON
File extension.json.jsonl / .ndjson
Media typeapplication/jsonapplication/x-ndjson (common)
Data typesstring, number, boolean, null, object, arrayany JSON value per line
CommentsNoNo
NestingUnlimitedUnlimited (per line)

Frequently asked questions

5 answers
How do I convert a JSON array to JSON Lines?
Paste the array; each element appears on its own line as compact JSON. Copy it or download a .jsonl file.
Does BigQuery accept this output?
Yes. BigQuery's newline-delimited JSON format is exactly one JSON object per line, UTF-8 encoded.
What if my JSON isn't an array?
A single object or value is written as one line. To split records, the top level must be an array.
Can I convert it back?
Yes — JSONL to JSON collects the lines back into an array.
Is my data uploaded anywhere?
No. The JSON is parsed and converted by JavaScript in your browser tab; nothing is sent to a server, so it is safe for internal exports, customer lists and configuration files with secrets.