Code Beautifier

JSONL to JSON Converter

Convert JSON Lines (NDJSON) to a JSON array and back, with the exact line number of any bad record.

Draft saved locally.

Local workspace

Named projects in IndexedDB · Local only — never synced to our servers. Worksp

Open manager

Batch workspace

Format multiple files locally in one run.

Direction:
Indent:
jsonl
json

Options

OptionDescription
DirectionDetect turns a JSON array into JSON Lines and reads anything else as JSON Lines. Pick a direction to force it.
IndentFormatting of the JSON array output. JSON Lines output is always one compact record per line.

FAQ

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

JSON Lines (.jsonl) and NDJSON are the same idea: one complete JSON value per line, with no enclosing array. A regular JSON file holds a single value, so a list of records has to be wrapped in [ ].

How do I prepare a JSONL file for fine-tuning or batch APIs?

Paste a JSON array of records and convert it, and each item becomes one line. Fine-tuning and batch files for LLM APIs, BigQuery loads, and most log pipelines accept this format.

Why does conversion fail on a specific line?

Every line must be a complete JSON value. A pretty-printed object split across several lines isn't valid JSONL. The error gives the line and column of the first bad record.

Are blank lines and Windows line endings OK?

Yes. Blank lines are skipped and CRLF line endings are handled, so files exported on Windows convert cleanly.

Can a JSONL line be an array or a string instead of an object?

Yes. Any JSON value is allowed on a line, although most tools expect objects.