Home › Developer Tools › JSONL to JSON Converter

JSONL to JSON Converter

Convert JSON Lines (JSONL, NDJSON) into a standard JSON array, or turn a JSON array into one JSON object per line. Invalid lines are listed with their line number and the exact problem, and large files are streamed so they convert without freezing the page.

Last updated:

Runs in your browser. Nothing is uploaded.

Preview
Advertisement
Advertisement

How to use the JSONL to JSON Converter

  1. Pick the direction: JSONL → JSON or JSON → JSONL.
  2. Paste your data or open a file (.jsonl, .ndjson or .json). You can also drop the file on the input box.
  3. Check the report: the summary shows how many records were converted, and any invalid lines are listed. Click a line to jump to it.
  4. Choose the formatting: indentation for JSON, or which array to export and whether to sort keys for JSONL.
  5. Download or copy the result.

JSONL vs JSON at a glance

JSON Lines (.jsonl, .ndjson)JSON array (.json)
StructureOne JSON value per line, separated by \nOne value; records sit inside [ … ] separated by commas
Example{"id":1}
{"id":2}
[{"id":1},{"id":2}]
Append a recordWrite one more lineRewrite the closing bracket
Read huge filesLine by line, low memoryUsually needs the whole file in memory
Typical usesLogs, ML datasets, BigQuery / Elasticsearch bulk loads, API streamingConfig files, API responses, web apps

Common JSONL errors and how to fix them

  • Trailing comma such as {"a":1,}: JSON does not allow a comma before } or ]. Remove it.
  • Single quotes such as {'a':1}: keys and strings must use double quotes.
  • A record split over several lines: in JSONL each value must sit on one line. Pretty-printed objects show up as many invalid lines; convert them with the JSON → JSONL direction instead.
  • Comma at the end of each line: lines copied out of a JSON array often end with ,. Remove the commas or paste the whole array into JSON → JSONL.
  • Unescaped line breaks inside strings: a newline inside a value must be written as \n.

Want to inspect the result? Open it in the JSON Viewer, or turn the records into a spreadsheet with JSON to CSV.

Frequently asked questions

What is a JSONL file?

JSONL (JSON Lines), also called NDJSON (newline-delimited JSON), is a text format where every line is one complete JSON value, usually an object. It is popular for logs, data exports, BigQuery and Elasticsearch bulk loads, and machine-learning datasets because files can be read and appended one line at a time.

How do I convert JSONL to a JSON array?

Paste the JSON Lines or open the .jsonl file with JSONL → JSON selected. Each non-blank line is parsed and placed in a JSON array, in the original order. Download the result as a .json file or copy it.

What happens to invalid lines?

With Skip invalid lines ticked (the default), lines that are not valid JSON are left out and listed with their line number, column and the parser's reason, for example a trailing comma or a missing quote. Untick it to stop at the first invalid line instead.

Can it handle very large JSONL files?

Yes. Files over 4 MB are read as a stream, a chunk at a time, so the page stays responsive and shows progress. The converted output is assembled in memory, so files of several hundred MB work on a typical computer.

How do I convert a JSON array to JSONL?

Choose JSON → JSONL and paste the array. Each item becomes one minified line. If the JSON is an object such as {"data": [...]}, the largest array inside it is used automatically, or you can type a path like data.items.

Are blank lines allowed in JSONL?

The JSON Lines format expects one value per line, but blank lines are common in real files. They are ignored and counted separately in the summary, so they never cause an error.

Is my data uploaded?

No. The conversion runs entirely in your browser with JavaScript. Your files and text are never sent to a server.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to TOML ConverterConvert JSON to clean TOML with tables, arrays of tables, inline tables and dates.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.Boolean Algebra SimplifierSimplify boolean expressions or minterm lists to minimal SOP and POS with Quine-McCluskey steps.Compare Excel FilesCompare two Excel spreadsheets cell by cell, highlight changes and export a diff report.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.
See all 129 Data & File Format Converters →