Loading NDJSON Validator...
Please wait a moment

How to Validate NDJSON Data

Check each line of your Newline Delimited JSON for valid syntax, data types, and structure

Step 1

Input Your NDJSON Data

Paste your NDJSON data into the editor. Each line should be a valid JSON value — an object, array, string, number, boolean, or null. The validator checks every non-empty line independently using JSON.parse().

Paste directly: Copy NDJSON from log files, streaming APIs, or data pipeline exports
Upload a file: Click "Upload" to select a .ndjson, .jsonl, or .txt file
Try the sample: Click "Sample" to see validation with both valid and invalid lines

Example: NDJSON Input with Mixed Valid and Invalid Lines

Real-world data often contains errors — paste it in to find exactly which lines are problematic:

{"event":"login","user_id":"u_001","timestamp":"2024-01-15T10:00:00Z"}
{"event":"view","user_id":"u_002","timestamp":"2024-01-15T10:01:00Z"}
{event: "purchase", user_id: "u_001", amount: 49.99}
{"event":"logout","user_id":"u_002,"timestamp":"2024-01-15T10:05:00Z"}
{"event":"signup","user_id":"u_003","timestamp":"2024-01-15T10:06:00Z"}

Lines 3 and 4 are invalid — line 3 uses unquoted keys, line 4 has an unterminated string value.

Step 2

Review Validation Results

The validator checks each line individually using the JSON RFC 8259 standard and provides a detailed report:

Line-by-line status: Each line is marked valid or invalid with a clear color-coded indicator
Type detection: Valid lines show their detected JSON type (object, array, string, number, boolean, null)
Error messages: Invalid lines display the specific parsing error to pinpoint exactly what needs fixing
Summary report: See total lines, valid count, and invalid count at a glance

Example: Validation Results

Each line shows status, type, and any error message — making it easy to locate and fix problems:

 Line 1  valid   type: object
 Line 2  valid   type: object
 Line 3  invalid  Unexpected token e in JSON at position 1
 Line 4  invalid  Unterminated string in JSON at position 36
 Line 5  valid   type: object

Summary: 5 lines — 3 valid, 2 invalid
Step 3

Export Validation Report

Share your validation results or use them to drive data quality decisions:

Summary card: See total lines, valid count, and invalid count at a glance — suitable for pipeline dashboards
Copy report: Copy a text-based validation report to share with your team or include in incident logs
Fix and convert: After fixing invalid lines, use NDJSON to JSON or NDJSON to CSV to continue your workflow

What is NDJSON Validation?

NDJSON validation checks that each line of a Newline Delimited JSON file is syntactically valid JSON as defined by RFC 8259. Unlike standard JSON validation, NDJSON validation processes each line independently — a single invalid line does not invalidate the entire file.

Validation is critical when working with data from the Elasticsearch Bulk API, Google BigQuery exports, MongoDB mongoexport output, and structured logging systems. These pipelines can produce corrupted or partial lines during network timeouts or write errors, making pre-validation essential before ingestion.

The validator uses the browser's native JSON.parse() for maximum accuracy, following the same parsing rules as the JSON Lines specification. All processing runs entirely in your browser — your data is never sent to any server.

Frequently Asked Questions

What makes NDJSON valid?

Each non-empty line must be a valid JSON value — an object, array, string, number, boolean, or null as defined by RFC 8259. Empty lines are skipped. Unlike standard JSON, there are no commas between lines and no wrapping array brackets.

What are common NDJSON errors?

Common errors include trailing commas in JSON objects, unquoted property names, single-quoted strings (JSON requires double quotes per the NDJSON spec), unterminated strings, and accidentally including array brackets or commas between lines.

Does each line have to be an object?

No. While most NDJSON files contain objects (one per line), the JSON Lines format allows any valid JSON value on each line — arrays, strings, numbers, booleans, and null are all valid.

Can I fix invalid lines after validation?

Yes. After identifying which lines have errors, edit them directly in the input editor. The validator re-runs automatically so you can verify your fixes in real time. Once all lines are valid, convert using NDJSON to JSON, NDJSON to CSV, or NDJSON to Table.

Which services commonly output NDJSON that may need validation?

The Elasticsearch Bulk API, Google BigQuery JSON exports, MongoDB mongoexport, Apache Kafka consumers, structured logging libraries (Pino, Bunyan, Winston), and AWS CloudWatch log exports all produce NDJSON that may contain partial or malformed lines.

What happens to empty lines?

Empty lines are automatically skipped during validation, as per the NDJSON specification. Only non-empty lines are parsed and included in the validation report and summary counts.

Is this validator free?

Yes, completely free with no limits. All processing happens in your browser using the native JSON.parse() API — your data never leaves your device.