Convert NDJSON to JSON Online
Convert NDJSON files to JSON format directly in your browser. No upload required — your data never leaves your device.
About converting NDJSON to JSON
Converting NDJSON to a JSON array wraps every line in one document: an opening bracket, the records separated by commas, and a closing bracket. You need this when a tool expects a single JSON value, such as a fetch call that uses response.json(), a mock API fixture, a Postman request body, a charting library that takes an array, or a JSON viewer with collapsible nodes.
The output is pretty-printed with two-space indentation, which makes a log sample far easier to read but noticeably larger on disk. Records keep the order of the lines. Blank lines are skipped, and the conversion stops at the first line that is not valid JSON, so remove a partially written last line before converting a log that is still being appended to. Keep in mind that most JSON parsers load the whole array before returning anything, so large files are better left as NDJSON.
Going from one object per line to an array also normalises the records. Every object gets every key found in the file, with null where a line did not have it, and keys appear in a consistent order. For JSONL datasets used in machine learning, such as chat fine-tuning files with a messages list, check that your validator accepts the added nulls: an optional name key present on only some messages is written as "name": null on the rest.
Not sure which format you need? Read the JSON vs NDJSON comparison.
Worked example
A small sample file, converted with the default settings.
Input (NDJSON)
{"ts":"2026-03-02T14:05:11.042Z","level":"info","service":"checkout","status":200,"latency_ms":41.7,"user_id":"u_1842"}
{"ts":"2026-03-02T14:05:12.310Z","level":"error","service":"checkout","status":502,"latency_ms":3012.4,"user_id":null}
{"ts":"2026-03-02T14:05:12.877Z","level":"info","service":"search","status":200,"latency_ms":12.9,"user_id":"u_0077"}
{"ts":"2026-03-02T14:05:14.105Z","level":"warn","service":"search","status":429,"latency_ms":0.8,"user_id":"u_1842"}Output (JSON)
[
{
"ts": "2026-03-02T14:05:11.042Z",
"level": "info",
"service": "checkout",
"status": 200,
"latency_ms": 41.7,
"user_id": "u_1842"
},
{
"ts": "2026-03-02T14:05:12.310Z",
"level": "error",
"service": "checkout",
"status": 502,
"latency_ms": 3012.4,
"user_id": null
},
{
"ts": "2026-03-02T14:05:12.877Z",
"level": "info",
"service": "search",
"status": 200,
"latency_ms": 12.9,
"user_id": "u_0077"
},
{
"ts": "2026-03-02T14:05:14.105Z",
"level": "warn",
"service": "search",
"status": 429,
"latency_ms": 0.8,
"user_id": "u_1842"
}
]What changes when you convert NDJSON to JSON
- The four log lines become four objects inside [ and ], separated by commas.
- Each object is indented with two spaces, and each key sits on its own line.
- The error record keeps "user_id": null. Keys missing from a line are also written as null.
- ts strings with milliseconds, such as "2026-03-02T14:05:11.042Z", are copied unchanged. Whole-second values like 2026-03-02T14:05:11Z are detected as timestamps and come back as "2026-03-02 14:05:11".
- Integers larger than 9,007,199,254,740,991, such as snowflake-style IDs, are written as strings to protect their digits.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Frequently Asked Questions
Why is the JSON file bigger than the NDJSON file?
The output is indented, so every key gets its own line and leading spaces, and missing keys are filled in with null. A compact single-line array is not an option here; if you need one, run the output through jq -c . or keep the data as NDJSON.
I have a .json file that is really one object per line. Which converter should I use?
Either works. Files ending in .json are checked for both layouts, so a line-delimited file with a .json name loads correctly on this page and on the JSON pages. Files ending in .ndjson or .jsonl are always read strictly line by line.
Does this work for JSONL fine-tuning or evaluation datasets?
Yes. Nested fields such as a messages list of role and content objects stay nested in the array output. The only structural change is that optional keys missing from some records are filled in with null.
What is JSON format?
JSON (JavaScript Object Notation) is a lightweight, human-readable format that supports nested structures, making it ideal for APIs and document-oriented data.
Related Tools
Convert JSON to NDJSON Online
Convert JSON files to NDJSON format directly in your browser. No upload required — your data never leaves your device.
JSON Viewer Online
View and inspect JSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
NDJSON Viewer Online
View and inspect NDJSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Filter JSON Files Online
Filter rows in JSON files by column value, directly in your browser. Your data stays on your device.
Convert NDJSON to CSV Online
Convert NDJSON files to CSV format directly in your browser. No upload required — your data never leaves your device.
Convert NDJSON to Parquet Online
Convert NDJSON files to Parquet format directly in your browser. No upload required — your data never leaves your device.
Convert NDJSON to Excel Online
Convert NDJSON files to Excel format directly in your browser. No upload required — your data never leaves your device.