JSONL to JSON conversion turns JSON Lines or NDJSON records into a single JSON document, usually an array of objects. Paste the lines into JSON Formatter & Converter, convert them in your browser, then format, minify, validate, compare, download, or export the result to another format. The tool is free and does not require signup.
JSONL is common in logs, analytics exports, search indexes, queues, and data pipelines because each line can be read independently. Standard JSON tools, however, often expect one complete JSON value. If you paste raw JSONL into a strict JSON formatter, it may fail after the first line because there is no wrapping array. Converting JSONL to JSON fixes that by collecting each valid line into one array you can inspect and reuse.
What is JSONL?
JSONL means JSON Lines. It is also called NDJSON, short for newline delimited JSON. The format is simple: every non-empty line contains one complete JSON value. Most files use one object per line, but a line can also be an array, string, number, boolean, or null if that is what the producer writes.
{"id":1,"event":"signup","plan":"free"}
{"id":2,"event":"login","plan":"pro"}
{"id":3,"event":"export","plan":"pro"}{"id":1,"event":"signup","plan":"free"}
{"id":2,"event":"login","plan":"pro"}
{"id":3,"event":"export","plan":"pro"}Those three lines are not one valid JSON document together. They are three valid JSON values placed one after another with newlines between them. That structure is excellent for streaming because a program can append one event at a time without rewriting the whole file. It is less convenient when you want to pretty-print, search a tree, compare two exports, convert to CSV, or send the data to an API that expects an array.
How to convert JSONL to JSON online
- Open JSON Formatter & Converter.
- Set the input format to JSON Lines (JSONL), or leave Auto-detect on if the sample is clear.
- Paste your JSONL text, open a local file through the browser, or use Import URL when the remote host allows CORS.
- Convert the records to JSON. The output becomes a JSON array that wraps each line as an item.
- Use Format, Minify, Validate, Tree, Compare, Convert, or Download depending on what you need next.
JSONL input and JSON output example
JSONL input:
{"id":1,"event":"signup","ok":true,"meta":{"source":"ad"}}
{"id":2,"event":"login","ok":true,"meta":{"source":"direct"}}
{"id":3,"event":"purchase","ok":false,"meta":{"source":"email"}}{"id":1,"event":"signup","ok":true,"meta":{"source":"ad"}}
{"id":2,"event":"login","ok":true,"meta":{"source":"direct"}}
{"id":3,"event":"purchase","ok":false,"meta":{"source":"email"}}Converted JSON array:
[
{
"id": 1,
"event": "signup",
"ok": true,
"meta": {
"source": "ad"
}
},
{
"id": 2,
"event": "login",
"ok": true,
"meta": {
"source": "direct"
}
},
{
"id": 3,
"event": "purchase",
"ok": false,
"meta": {
"source": "email"
}
}
][
{
"id": 1,
"event": "signup",
"ok": true,
"meta": {
"source": "ad"
}
},
{
"id": 2,
"event": "login",
"ok": true,
"meta": {
"source": "direct"
}
},
{
"id": 3,
"event": "purchase",
"ok": false,
"meta": {
"source": "email"
}
}
]After conversion, the output is ordinary JSON. You can format it for readability, minify it for a smaller payload, sort keys for review, strip nulls to reduce noise, flatten nested fields for table-style exports, unflatten data back into nested objects, or inspect the Tree view to jump around a large array.
The converted array is also easier to share with tools that do not understand streaming formats. Many validators, documentation systems, spreadsheet imports, and example viewers expect a single JSON value. A wrapped array makes the sample portable while preserving the order of the original lines.
When to use JSONL instead of JSON
JSONL is a good source format when records arrive one at a time. Log processors, event collectors, queue exports, and command-line scripts can append one JSON value per line without holding the full dataset in memory. That makes JSONL practical for ongoing streams and large append-only files.
Standard JSON is better when the document will be inspected, embedded, converted, or passed to a tool that expects one complete value. If you are preparing a short sample for documentation, a bug report, a support ticket, or a spreadsheet export, converting JSONL to a JSON array gives reviewers a format they can validate and browse more easily.
Common JSONL problems
JSONL is forgiving as a file format, but each line still has to be valid JSON. A single broken line can stop the conversion because the tool cannot safely guess what that record was supposed to mean.
- Trailing commas:
{"id":1,}is not valid JSON, even inside a JSONL file. - Single quotes:
{'id':1}looks familiar in some languages, but JSON strings and keys require double quotes. - Blank lines: many JSONL workflows ignore blank lines, but removing them can make errors easier to locate.
- Mixed schemas: one line may contain
emailwhile another containsphone. That is allowed JSONL, but it matters when converting to CSV or typed models. - Huge exports: a large log file can become a large array. Use the size panel to understand the byte count before downloading or converting again.
If a line fails to parse, fix the first reported problem and try again. The validate JSON online article covers common syntax errors such as comments, unquoted keys, and trailing commas. For Python-style data with True, False, None, or single quotes, the Python dict to JSON workflow may be a better starting point than strict JSONL.
Troubleshooting JSONL conversion
When a conversion fails, start by narrowing the sample. Paste the first few lines, convert them, and then add more lines until the error appears. This helps you find the exact record with an invalid quote, missing brace, unescaped newline, or trailing comma.
Watch for records that look like JSON but are actually log prefixes plus JSON, such as a timestamp followed by an object. A JSONL converter expects each line itself to be JSON. If your file has prefixes, severity labels, or tab-separated metadata before the object, remove that wrapper or extract the JSON part before converting.
Convert JSONL to CSV, XML, YAML, and code types
Once the JSONL records are wrapped as a JSON array, more conversions become available. A list of objects can often be exported to CSV or TSV when the fields are table-like. You can also convert to XML or YAML for configuration and integration work, or generate best-effort TypeScript, C#, Java, and related type shapes for quick modeling.
These converters are practical helpers, not a promise that every messy dataset maps perfectly. Deeply nested records, inconsistent keys, arrays inside cells, null-heavy objects, and mixed value types can require manual cleanup. Use Flatten when you need nested keys to become table columns, Strip nulls when optional fields create noise, and Sort keys when you want stable ordering before comparing two converted datasets.
Check size before exporting
JSONL logs can grow quickly because each record repeats keys. After converting to an array, open the JSON size calculator panel to compare character count, UTF-8 bytes, pretty size, minified size, depth, keys, and null counts. Minify can shrink a formatted array before download, while Format makes review easier when you are looking for one problematic record.
Compare is useful when you have two exports from different days or environments. Convert both samples to JSON arrays, sort keys if stable ordering helps, and compare the documents to see what changed. For smaller inspection tasks, Tree view can be faster than scanning raw text because you can expand only the records and fields you care about.
Import URL and privacy
Import URL fetches the remote resource from your browser. It works only when the remote host allows that browser request with CORS. Tools Viewer does not proxy the URL or work around a host that blocks browser access. If Import URL is blocked, download the file yourself, open it locally, or paste the JSONL text.
JSONL conversion, formatting, validation, minifying, tree inspection, size checks, compare, flattening, unflattening, and downloads run in your browser. Your pasted log data is not uploaded for conversion. The tool is free and no account is required.
Honest limits for JSONL files
Browser tools are best for samples, exports, fixtures, and review-sized files. Very large logs can use a lot of memory once every line becomes one array item in a single document. If you only need to debug a small issue, convert a representative slice instead of the entire log. If you need to process a massive file, use a dedicated data pipeline and then bring a smaller sample back to the formatter for inspection.
FAQ
Can I convert JSONL to JSON online?
Yes. Paste JSON Lines or NDJSON into JSON Formatter & Converter and convert the lines into a JSON array in your browser.
What is the difference between JSONL and JSON?
JSONL stores one JSON value per line. Standard JSON is one complete document, such as an array containing all records.
Can I convert JSONL to CSV?
Yes. Convert JSONL to a JSON array first, then choose CSV or TSV when the records are table-like enough for export.
Does each JSONL line have to be valid JSON?
Yes. Each non-empty line should parse as its own JSON value. Fix invalid lines before converting the full file.
Why does JSONL fail in a normal JSON formatter?
A normal JSON formatter expects one complete JSON document. JSONL contains multiple JSON values separated by newlines, so it usually needs to be wrapped as an array first.
Can I import JSONL from a URL?
Yes, if the remote host allows browser fetches with CORS. Import URL runs from your browser and Tools Viewer does not proxy it.
Is my JSONL uploaded?
No. Conversion, formatting, validation, and downloads run in your browser, with no signup required.
Related: JSON formatter online, validate JSON online, JSON size calculator, and convert JSON to XML. Full walkthrough: JSON Formatter guide. More posts: JSON formatter blog.
