JSON Lines (JSONL) to JSON Converter
Turn JSON Lines — one JSON value per line, as written by log shippers, BigQuery and MongoDB exports, and ML datasets — into a single JSON array, with the line number of any line that isn't valid JSON.
JSONL to JSON
Runs in your browser — nothing you enter is uploaded or stored.
Scratchpad auto-saved
How it works — in four simple steps
No signup and nothing to install — it all runs in your browser.
Add your JSON Lines
Paste it into the left box, press Open file, or drag a .jsonl file onto it. Sample loads a realistic example.
Set the options
Adjust the options above the boxes — the output updates instantly as you change them.
Check the result
Read the status line: it reports rows, keys and any value that couldn't be represented in JSON.
Copy or download
Copy the JSON or download it as a .json file. Nothing was uploaded at any point.
If a line won't parse, the error names its line number — handy for finding one truncated record in a big log.
Features
Pretty or minified
2 or 4 spaces, tabs, or a minified single line for the smallest possible file.
Private by design
Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.
About the JSONL to JSON
JSON Lines (also called newline-delimited JSON, NDJSON) stores one complete JSON value per line. It's the format of choice for anything streamed or appended: application logs, BigQuery and Elasticsearch exports, mongoexport output, OpenAI and other fine-tuning datasets, and the results of tools like jq -c. Because each line stands alone, files can be huge, split anywhere, and processed line by line.
Many tools, though, expect a single JSON document. This converter reads the input line by line, parses each non-empty line as JSON, and collects the values into one array in order. Blank lines are skipped, Windows line endings are handled, and a UTF-8 byte-order mark at the start is ignored. If any line fails to parse, conversion stops and the message names that line — useful for finding the one truncated record in a 10,000-line log.
The array can be pretty-printed with 2 or 4 spaces or tabs, or minified. To go back, use JSON to JSONL.
Examples
Structured access-log lines as written by a log shipper, with a blank line in the middle.
{"ts":"2026-10-21T09:00:01Z","method":"GET","path":"/","status":200,"ms":12}
{"ts":"2026-10-21T09:00:02Z","method":"GET","path":"/tools/csv-to-sql/","status":200,"ms":18}
{"ts":"2026-10-21T09:00:04Z","method":"POST","path":"/api/feedback","status":429,"ms":3,"retry_after":30}[
{
"ts": "2026-10-21T09:00:01Z",
"method": "GET",
"path": "/",
"status": 200,
"ms": 12
},
{
"ts": "2026-10-21T09:00:02Z",
"method": "GET",
"path": "/tools/csv-to-sql/",
"status": 200,
"ms": 18
},
{
"ts": "2026-10-21T09:00:04Z",
"method": "POST",
"path": "/api/feedback",
"status": 429,
"ms": 3,
"retry_after": 30
}
]This output was produced by the converter on this page with the default options — load it with the “Access log” preset above and change any option to see the effect.
How JSON Lines maps to JSON
| In JSON Lines | Becomes in JSON |
|---|---|
Line 1 {"a":1} | element 0 |
Line 2 {"a":2} | element 1 |
| Blank line | skipped |
| Line that is a number or string | that value as an element |
| Invalid line | error with its line number |
| CRLF line endings / BOM | handled |
Things that trip people up
- Pretty-printed objects aren't JSONL. If one record spans several lines, it isn't JSON Lines — paste it into the JSON Formatter instead.
- Huge files. Everything is held in your browser's memory. Files of tens of megabytes work in modern browsers; for gigabytes, use a streaming tool like jq.
- Mixed record shapes. Lines can be any JSON value and don't need the same keys — they're copied as-is.
- Trailing commas. A line ending with a comma (common when hand-editing) is invalid JSON; the error names the line.
JSON Lines vs JSON at a glance
| Property | JSON Lines | JSON |
|---|---|---|
| Specification | jsonlines.org · NDJSON | RFC 8259 (2017) · ECMA-404 |
| File extension | .jsonl / .ndjson | .json |
| Media type | application/x-ndjson (common) | application/json |
| Data types | any JSON value per line | string, number, boolean, null, object, array |
| Comments | No | No |
| Nesting | Unlimited (per line) | Unlimited |
- JSON Lines: One complete JSON value per line, UTF-8, separated by \n — so files can be streamed, appended and split without parsing the whole thing.
- JSON: Numbers are parsed as IEEE-754 doubles in JavaScript, so integers above 9,007,199,254,740,991 (2⁵³ − 1) lose precision.