Wapgee Logowapgee

Tools / JSON / JSONL

JSON ⇌ JSONL

Paste a JSON array or JSON Lines on the left. The tool detects the format, converts both ways, and lets you copy or download the result. Built for LLM fine-tuning files and batch APIs that expect one JSON object per line.

InputJSON
JSONL

JSON arrays and JSON Lines

A JSON array is one document: opening bracket, comma-separated values, closing bracket. JSON Lines (JSONL, also called NDJSON) is the same values written one per line with no wrapping array. That shape streams well, appends without rewriting the file, and is what OpenAI and Claude batch APIs expect for request files and what many fine-tuning pipelines use for training examples.

JSON
[
  { "prompt": "hi", "completion": "hello" },
  { "prompt": "bye", "completion": "goodbye" }
]
JSONL
{"prompt":"hi","completion":"hello"}
{"prompt":"bye","completion":"goodbye"}

Auto-detect and both directions

Paste either form on the left. If the whole input parses as JSON, the tool converts to JSONL (one compact value per line). If it does not, but individual lines parse, it builds a JSON array. Use Direction to force JSON → JSONL or JSONL → JSON when auto-detect is wrong for your file. Pretty JSON controls indentation on the array output; JSONL is always compact.

Blank lines are ignored. CRLF and LF both work. Trailing newlines are fine. Invalid JSONL lines show their line number; turn on Skip bad lines to keep the rest of the file.

Fine-tuning and batch files

When a provider asks for a .jsonl upload, start from the JSON array you already have in tests or fixtures, convert here, then download. Going the other way is useful for inspecting a batch result file as a single pretty-printed array in an editor. Everything stays in the browser, so corpora with private prompts are safe to paste.

FAQ

Is my data uploaded?

No. Conversion runs in your browser. Nothing is sent to a server, so batch files and fine-tuning corpora stay on your device.

What is JSONL used for?

JSON Lines (also called NDJSON) stores one JSON value per line. OpenAI and Claude batch APIs, LLM fine-tuning datasets, and many log pipelines use this format because it streams and appends cleanly.

What happens on invalid lines?

JSONL to JSON reports the line number of each bad line. Turn on Skip bad lines to keep the valid rows and drop the rest.

The weekly download

One new tool a week. No spam.