Skip to content
CleanGlyph home

JSONL to JSON Converter & Validator Online

Turn JSON Lines (JSONL, also called NDJSON) into a JSON array, convert a JSON array back to JSONL, or validate every line. Exact numbers are kept and everything runs locally in your browser.

Your text never leaves your browser.

0 code pointsAnalyzed as you type

JSON output

Paste JSON Lines (one JSON value per line) or open a .jsonl, .ndjson or .txt file to combine them into a JSON array.

Conversion options

Mode
Input lines

Skip empty and whitespace-only lines instead of reporting them. Invalid records are never skipped.

JSON array style

How to convert JSONL to JSON online

Choose JSONL to JSON, then paste your lines, open a local .jsonl, .ndjson or .txt file, or load the sample. Each line is parsed as one JSON value and the values are combined into a JSON array in their original order. Pick a readable array with one record per line, or a compact single-line array, then copy or download it as a .json file.

JSONL input
{"id":9007199254740993,"price":1.00}
{"id":2,"price":2.50}
JSON output
[
  {"id":9007199254740993,"price":1.00},
  {"id":2,"price":2.50}
]

How to convert a JSON array to JSONL

Choose JSON to JSONL and paste a JSON document whose top level is an array. Every element is written on its own line, with formatting whitespace between tokens removed so each record fits on one physical line. Spaces inside strings are kept. The output ends with a single newline unless you turn that option off. An empty array gives an empty, valid result.

JSON input
[
  { "name": "Ana", "amount": 1.00 },
  { "name": "Jonas", "amount": 2.50 }
]
JSONL output
{"name":"Ana","amount":1.00}
{"name":"Jonas","amount":2.50}

What JSONL and NDJSON mean

JSON Lines (JSONL) is a text format where every line holds one complete JSON value. NDJSON, short for newline-delimited JSON, describes the same idea. Files are UTF-8 without a byte order mark, lines are separated by \n (a \r\n ending is also accepted), and a final newline is optional. Because a JSON string cannot contain a raw line break, a line break inside a value is always written as the escape \n.

JSON vs JSONL: differences and use cases

A JSON document is a single value, usually one array or object, that must be read completely before it can be used. JSONL is a stream of independent values: you can append a record without rewriting the file, read it one line at a time, and split it at any line boundary. That is why logging pipelines, data exports and machine-learning datasets favour JSONL, while APIs and configuration files use regular JSON.

It is also why a standard JSON formatter rejects JSONL. After reading the first line the parser expects the document to end, so it reports an error such as unexpected content after JSON. Convert the lines to an array here, then use the JSON Formatter & Validator if you need to pretty-print or inspect the result, or the JSON Schema Validator to check it against a schema.

How line-by-line validation works

Validate JSONL checks each line on its own with a strict JSON parser and never changes the input. It reports the number of records, how many are valid or invalid, how many lines are blank, and the original 1-based line number of every problem with the parser's message. Exact column positions are not shown because they are not reported reliably across browsers.

Input
{"id":1,"status":"ok"}
{"id":2,"status":"ok",}
{'id':3}
Result
Line 2: trailing comma not allowed
Line 3: single quotes are not valid JSON

Handling empty lines and malformed records

Empty records are not valid JSON Lines, so blank and whitespace-only lines are reported as errors by default. A single newline at the very end of the file is not a blank line. Turn on Ignore blank lines to skip them on purpose. Malformed non-empty lines are never skipped, guessed at or repaired: if any line is invalid, no output is produced, so a partial array can never be mistaken for a complete one. A byte order mark at the start of the input is rejected rather than silently removed.

Large numbers and data preservation

Converting through JavaScript's JSON.parse and JSON.stringify rounds integers above 2^53 and rewrites numbers such as 1.00 to 1 or 1e+20 to 100000000000000000000. This tool uses the parser only to validate, then copies each value from your source text with a scanner that understands strings, escapes and nesting. Numbers, string escapes, key order and duplicate keys stay exactly as written; only whitespace between tokens can change.

Working with API logs and datasets

Structured logs, event streams, BigQuery and database exports, and fine-tuning datasets are commonly stored as JSONL. Convert a slice to a JSON array to inspect it, feed it to a tool that expects an array, or turn it into a table with the JSON to CSV Converter. Going the other way, a spreadsheet export can become JSON with the CSV to JSON Converter and then JSONL here. Use as input passes a result back with the reverse mode selected.

Privacy and local processing

Everything runs in your browser. Pasted text and opened files are not uploaded, logged, sent to analytics or stored. Files are decoded as strict UTF-8 and invalid byte sequences are rejected. Supported sizes are up to 1,000,000 UTF-16 code units of pasted input, 1 MiB files, 20,000 records and 5,000,000 code units of output. Larger inputs are refused with a message, never truncated.

Frequently asked questions

What is the difference between JSONL and NDJSON?

In practice none. JSON Lines (JSONL) and newline-delimited JSON (NDJSON) both store one complete JSON value per line, separated by newlines. The names come from two separate specifications that describe the same format, and files often use either .jsonl or .ndjson.

Why does my JSON formatter reject a JSONL file?

A JSON document must contain exactly one top-level value. A JSONL file contains many values one after another, so a standard JSON parser stops after the first line with an error such as "Unexpected non-whitespace character after JSON". Convert the lines to a JSON array first, or validate them line by line.

Are blank lines allowed in JSONL?

JSON Lines does not allow empty records, so blank and whitespace-only lines are reported as errors by default. A single final newline at the end of the file is expected and is not treated as a blank line. Turn on Ignore blank lines if your producer adds them and you want to skip them deliberately.

What happens when one line is invalid?

Conversion stops and no partial result is shown. The tool lists the line number and the parser message for each invalid line. Malformed records are never skipped or repaired automatically, so you can fix the source instead of losing data silently.

Are large numbers and decimals kept exactly?

Yes. Values are copied from the source text rather than re-serialized, so 9007199254740993, 1.00, 1e+20 and -0 stay exactly as written. Only insignificant whitespace outside strings may change.

Does the JSON array need a specific structure to convert to JSONL?

The top-level value must be an array. Its elements can be objects, arrays, strings, numbers, booleans or null, and each element becomes one line. A top-level object or a single value is rejected because there is no list of records to split.

Is my data uploaded anywhere?

No. Parsing, validation and conversion run entirely in your browser. Pasted text and opened files are not sent to a server, analytics or error reporting, and nothing is stored after you leave the page.

What are the size limits?

You can paste up to 1,000,000 UTF-16 code units or open UTF-8 files up to 1 MiB, with up to 20,000 records and 5,000,000 code units of output. Larger inputs are rejected with a message and are never truncated.