NDJSON Converter: JSONL to CSV, JSON and Excel
Pricing
from $0.02 / 1,000 converted rows
NDJSON Converter: JSONL to CSV, JSON and Excel
Convert NDJSON / JSON Lines to CSV, JSON array or Excel, and CSV, JSON or Apify datasets back to NDJSON. Flattens nested objects, keeps every column, reads .gz, skips broken lines and reports them. Empty input = free demo.
Pricing
from $0.02 / 1,000 converted rows
Rating
0.0
(0)
Developer
Actor Factory
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
a day ago
Last modified
Categories
Features
Share
Convert NDJSON / JSON Lines to CSV, JSON or Excel, and CSV, JSON or Apify datasets back to NDJSON, without writing a script
For anyone who has a .ndjson or .jsonl file and needs a spreadsheet, or has a spreadsheet and needs one JSON object per line. Typical cases: a log export or database dump you want to open in Excel, an Apify dataset you want to load into BigQuery or a streaming tool that expects JSON Lines, an API that returns one JSON object per line. Give this Actor file URLs or a dataset, pick the output format, and get the converted file plus a public download link.
$0.0015 per converted file plus $0.000035 per converted row ($0.035 per 1,000 rows). Broken lines are skipped and are not charged. The $5 monthly free credit covers about 130,000 rows in 1,000-row files. Failed files and the demo are free. No scraping, no API keys.
Try it free: leave the file list and dataset empty and press Start (clear the prefilled URL first). The demo converts a built-in NDJSON sample that contains a nested object, a list, a blank line and one broken line. It is not charged and the result row carries _demo: true.
The problems it solves
- You cannot open a
.jsonlfile in Excel. Convert it to CSV or.xlsx. Nested objects become columns with dotted names (customer.name), and the columns are the union of all lines, so a key that only appears in some lines still gets its own column. - One bad line breaks your import. A truncated line from a crashed export, a stray log message or a half-written last line does not stop the file. The bad line is skipped and listed in the result with its line number and the reason, so you can see exactly what was left out.
- A tool wants JSON Lines and you have a CSV, a JSON array or an Apify dataset. Convert it to NDJSON (or a
.jsonlfile) in one step. Numbers in a CSV become numbers; values like01234stay text so zip codes and IDs are not changed. - The file is compressed.
.gzfiles are unzipped automatically. - Several files, one run. Each file gets its own output file and one result row.
What it does
- NDJSON / JSONL to CSV, JSON array or Excel (.xlsx).
- Nested objects are flattened into dot keys (you can pick another separator).
- A list inside a line is written as JSON text, or joined with
;for lists of words and numbers. - Columns are the union across all lines, in the order they first appear.
- Blank lines are ignored, and a byte-order mark or Windows line endings do not matter.
- CSV, TSV, JSON array or Apify dataset to NDJSON / JSONL. A JSON file with one array inside an object (
{"items": [...]}) is read as that array. - NDJSON to cleaned NDJSON. Choose NDJSON as the output of an NDJSON file to drop the broken lines and blank lines.
- Reads UTF-8 (with or without BOM), UTF-16 with BOM, and, as a fallback, Shift_JIS and Windows-1252 text. Output is always UTF-8.
- Reports for each file: input and output format, rows, broken lines with details, columns, and whether it was gzip-compressed.
Input example
{"fileUrls": ["https://example.com/exports/events.jsonl.gz"],"outputFormat": "xlsx","arrayMode": "join"}
Converting a dataset: use datasetIds. Every item of the dataset becomes one row of the output file, which is NDJSON unless you choose another format. If a dataset's items hold contentBase64 (the file bytes, base64-encoded) and optionally fileName, each item is instead read as one file, exactly like a file URL.
Output
- Dataset: one row per source file.
- Key-value store: the converted file under
outputKey(for exampleevents.xlsx).urlis Apify's signed public link, so you can share the file without sharing your token. - STATS record: files converted and failed, rows converted, broken lines skipped and what was charged.
{"file": "https://example.com/exports/events.jsonl.gz","from": "ndjson","to": "csv","rows": 2500,"badLines": 1,"url": "https://api.apify.com/v2/key-value-stores/…/records/events.csv?signature=…","status": "ok","blankLines": 3,"badLineDetails": [{"line": 1207, "reason": "Expecting ',' delimiter (column 151)", "text": "{\"id\": 1207, \"user\": {\"name\": \"Ana\", \"vip\": fals"}],"encoding": "utf-8", "gzip": true, "columns": 14,"inputBytes": 118204, "outputBytes": 231905, "chargedRows": 2500, "chargedFiles": 1, "outputKey": "events.csv"}
badLineDetails lists the first 50 broken lines (the count in badLines is always complete). Line numbers count every line of the file, including blank lines.
Limits (cannot be raised by input)
- 50 MB per source file (100 MB after unzipping); 50 files per run (200 MB in total for files read from datasets); at most 500,000 rows per file. A file over a limit fails and is not charged
- A download is tried up to 3 times when the server is slow or answers with a temporary error (HTTP 429, 5xx); a clear error such as 404 is not retried. The timeout is 60 seconds per request
- Source URLs must be public
httporhttpslinks. Addresses on internal networks (localhost, private ranges, cloud metadata) are blocked, also after redirects - Input can be NDJSON / JSONL, JSON, CSV or TSV (optionally gzip-compressed). Excel workbooks and other binary files cannot be read
- A file with more than 1,000 different columns cannot be written as CSV or Excel; use JSON or NDJSON output instead
Pricing
Pay per event: $0.0015 per converted file (event file) plus $0.000035 per converted row (event row). Only rows that were written count: broken lines and blank lines are free. A 1,000-row file costs $0.0365 and a 100,000-row file costs $3.50. A file that fails (download error, no valid line, over a limit) is not charged. Set a maximum charge per run to cap spend; a file that does not fit in the remaining budget is skipped whole, never cut. If none of the files fit, nothing is converted or charged and the run ends as Failed ("No file could be converted. See the dataset rows for the reason."); each skipped file's row in the dataset says "Max charge reached before this file; it was not converted."
On the Apify Free plan, the $5 of monthly platform credit covers about 140,000 rows a month in large files, enough to try it on real data.
FAQ
What is the difference between NDJSON and JSONL? Nothing in the content: both mean one JSON value per line. The Actor reads both, and lets you choose the file extension of the output.
What happens to nested lists? In CSV and Excel they are written as JSON text in one cell, or joined with ; if you choose "join" and the list holds only text, numbers or booleans. In JSON and NDJSON output they stay as they are.
Why are some CSV cells numbers and others text? When reading CSV, cells like 12 and 3.5 become numbers. Cells with a leading zero, more than 15 digits or an exponent stay text. Turn the option off to keep everything as text.
Can an Excel file be the input? No. Export the sheet as CSV first.
Does it change my source? No. It only reads the file and writes a new one.
Is the file link private? Anyone holding the signed link can download that file; it gives no access to anything else in your account.
Will formulas in my data run in Excel? In .xlsx output text that starts with = is stored as text. For CSV, turn on "neutralize formulas" if the data comes from an untrusted source.
If this Actor saved you time, a rating on the Store helps others find it.
More tools from the same developer
- CSV to JSON Converter — turn CSV files into typed JSON: encoding and delimiter detected, numbers and booleans typed, dotted headers nested, array, NDJSON or keyed output
- JSON to CSV Converter — turn nested JSON files or datasets into one flat CSV file
- Flatten JSON to CSV — flatten nested JSON into flat rows with the separator you choose
- CSV to Excel Converter — convert CSV, TSV, Excel XLSX, JSON and NDJSON files or Apify datasets into each other
- CSV Encoding Converter — detect the encoding of CSV and text files and convert them to UTF-8 (or another encoding)