NDJSON to JSON Array Converter
Paste your NDJSON lines to merge them into one JSON array.
Result
How it is calculated
The input is split into lines (Windows, Unix and old Mac line endings all work) and blank lines are ignored. Each remaining line is parsed on its own as one JSON value, and the parsed values are collected, in order, into one array, printed with four-space indentation and unescaped Unicode. The tool reports the number of lines converted and a valid flag. A line that is not valid JSON is skipped, not repaired, and flips the flag to No, while the good lines are still converted. A line with the literal null is kept as null. Lines may hold objects, arrays, numbers or strings, and one line may not span several lines of text.
Worked example
Paste three lines: {"id":1,"name":"Ada"}, {"id":2,"name":"Linus"} and {"id":3,"name":"Grace"}. Each is a valid JSON object, so the tool puts them in a single array in the same order: an opening bracket, the three objects separated by commas, and a closing bracket. The line count shows 3 and the valid flag shows Yes. If the second line were damaged, say {"id":2,, the array would hold only two objects, the count would be 2 and the flag No.
Common mistakes
- Pasting a pretty-printed or multi-line object. Each record must sit entirely on one line, otherwise the individual lines are not valid JSON and are dropped.
- Ignoring the valid flag. A malformed line is silently left out of the array, so check that the line count matches the number of records you expected.
- Pasting a JSON array that is already complete. It is read as a single line and comes back wrapped in a second array, giving
[[...]]. - Trailing commas between lines. NDJSON lines are not separated by commas; a line ending in a comma is invalid and is skipped.
- Using single quotes or unquoted keys, which are accepted by some tools but are not valid JSON and fail here.
About this calculator
NDJSON (Newline Delimited JSON, also called JSON Lines or .jsonl) stores one complete, self-contained JSON object per line instead of wrapping everything in a single top-level array. This format is popular for streaming and append-only data because a producer can write one record at a time without ever needing to rewrite the whole file, and a consumer can process it line by line without loading the entire dataset into memory.
Tools like Elasticsearch's bulk API, Fluentd and other log shippers, Spark and BigQuery data loaders, and many machine-learning dataset formats all emit or expect NDJSON. This converter parses each line as an independent JSON value and combines them into a single pretty-printed JSON array, which is the format most general-purpose JSON viewers, `jq` pipelines, and REST APIs expect when NDJSON isn't directly supported.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
A quick integrity check: the converted-lines count should equal the number of non-empty lines in your file. If it is lower and the validity flag says No, some lines were skipped; typical causes are a record wrapped over two lines or a stray trailing comma. Fix those at the source rather than in the output, since the tool repairs nothing. Where does your NDJSON come from: a database export, an API stream, or logs?