jsonlkit.com
JSONL (JSON Lines) utilities, in the browser
Say hi →

JSON to JSONL Converter

updated 28 April 2026

100% client-side. Your data never leaves the browser.

Convert

Drop a .json file here, or

JSON to JSONL Converter

Paste a JSON array, get JSONL back — one record per line, ready for OpenAI / Anthropic fine-tune uploads, BigQuery loads, or any tool that expects newline-delimited JSON.

Before you start

You need a top-level JSON array — something that opens with [ and closes with ]. Each item inside the array becomes one line in the output. That item can be an object, a number, a string, even a nested array; whatever it is, I will JSON.stringify it onto a single line.

If your file is a single bare object ({...}) instead of an array, this tool can't help directly — JSONL is fundamentally a stream of records, so you'll need to wrap it: [{...}]. If your file is already JSONL, you're done; you don't need this tool.

There is no hard size limit beyond your browser's memory. The whole array gets parsed into a JS value first, so for very large files (over ~200 MB) I'd recommend a CLI like jq -c '.[]' input.json > out.jsonl instead.

Why JSONL is everywhere now

JSONL (sometimes called NDJSON) has quietly become the default for one specific reason: LLM fine-tuning. Both OpenAI and Anthropic require fine-tune training files in JSONL format — one chat example per line. If your training data starts life as a JSON array exported from a database or a labelling tool, you need to "unwrap" it before uploading. That's literally what this page does.

Beyond fine-tunes, JSONL shows up in:

How to use it

  1. Paste your JSON array into the Input pane, or drop a .json file onto the page.
  2. Click JSON array → JSONL. I parse the whole array, then stringify each element onto its own line.
  3. Check the status bar for the line count, or the error pane if something failed to parse.
  4. Click Copy or Download .jsonl to save the result.

Example

Input (JSON array):

[
  {"id": 1, "user": "Ada"},
  {"id": 2, "user": "Linus"}
]

Output (JSONL):

{"id":1,"user":"Ada"}
{"id":2,"user":"Linus"}

Notice that the output is minified on each line — that's what every JSONL consumer expects. Trailing newline included so cat file1 file2 > combined still works.

Fine-tune dataset workflow

If you exported a chat dataset from a labelling tool as a JSON array, the typical pipeline looks like:

  1. Paste the array here, click convert. Now it's JSONL.
  2. Run the result through the OpenAI Fine Tune Validator to catch missing messages arrays, bad roles, or empty assistant turns.
  3. Upload to OpenAI's files endpoint and start your fine-tune job.

I built these three tools to be used in sequence — they live in the same browser tab and don't need anything installed.

Tips & common pitfalls

Troubleshooting

It says "Expected a JSON array at top level."

Your input parsed as JSON, but it wasn't an array — it was probably an object. Wrap it in square brackets, or if you actually have JSONL already (multiple objects with no commas between them), just use the file directly; you don't need this tool.

"Input is not valid JSON."

Common culprits: trailing commas, single quotes instead of double quotes, unescaped newlines inside strings, or a leading byte-order mark. Run it through the Validator if you can convert to JSONL first, or paste into a JSON linter to find the exact offset.

My browser tab froze.

The whole array gets parsed into memory, then each item is serialized again. For files over a few hundred megabytes, that doubles memory use. Use jq -c '.[]' input.json on the command line for huge files.

Related tools

See also: if you need to do something adjacent on this site, try JSONL to CSV to flatten your fresh JSONL into a spreadsheet, Formatter to pretty-print or minify each JSONL record, or Viewer to inspect the converted records before uploading.

Frequently asked questions

What's the difference between JSON, JSONL, and NDJSON?

JSON is the format. JSONL (JSON Lines) and NDJSON (Newline Delimited JSON) are two names for the same convention: a file where every line is one self-contained JSON value. Both names refer to the same byte stream.

Does this tool keep my key order?

Yes. JSON.parse followed by JSON.stringify on a modern engine preserves the insertion order of string keys, so your records won't be shuffled.

Can I use this for OpenAI / Anthropic fine-tune files?

That's the main use case. Convert here, then run it through the OpenAI Fine Tune Validator to check role/content/assistant requirements before you upload.

What about a JSON file that's a stream of objects with no array brackets?

That's already JSONL (or "concatenated JSON"). You don't need this tool — feed it directly to whatever consumer wants newline-delimited records.

How can I do this from the command line?

jq -c '.[]' input.json > output.jsonl is the standard one-liner. For Python: import json; [print(json.dumps(x)) for x in json.load(open('in.json'))].

Is my file uploaded anywhere?

No. Every byte stays in your browser tab. The conversion runs in JavaScript on your machine, which is why I'm comfortable using this for sensitive training data and you should be too.