A JSONL formatter (JSON Lines / NDJSON) processes files where each line is a separate JSON object. It pretty-prints each record, highlights invalid lines, counts total records, and converts between JSONL and standard JSON arrays — useful for log files, data pipelines, and streaming API responses.
JSONL Examples
How to Use the JSONL Formatter
JSONL (JSON Lines) files from log aggregators, streaming APIs, or data pipeline exports can be difficult to read because each record is on a single line. A JSONL formatter expands each record with indentation, highlights invalid lines, and provides record counts so you can quickly understand and debug your data.
Step 1: Paste Your JSONL
Copy your JSONL content — one JSON object per line — and paste it into the input area. Each line should be a complete, valid JSON value. Empty lines are skipped automatically. The formatter counts total lines, valid records, and invalid lines.
Step 2: Choose Format Mode
Format Lines expands each JSON object with indentation for easy reading — ideal for debugging. Compact minifies each line back to one JSON per line — the standard JSONL format for log files. Invalid lines appear in red with the parse error message.
Step 3: Convert Formats
Use → JSON Array to wrap all valid lines into a single JSON array — useful when an API or library expects standard JSON. Use Array → JSONL to split a JSON array back into one-per-line JSONL format.
JSONL Use Cases
JSONL is the preferred format for append-only log files (each entry is independent), streaming APIs (server sends records one at a time), machine learning datasets (shuffle or split by record), and data pipelines (process records without loading the entire file). Tools like jq, Apache Kafka, and Elasticsearch all support JSONL natively.
FAQ
Is the JSONL formatter free?
Yes, completely free with no signup required. Format unlimited JSONL files in your browser.
Is my data safe?
Yes. All formatting runs locally in your browser. Your data is never sent to any server.
What is JSONL?
JSONL (JSON Lines) is a format where each line is a complete, valid JSON value — typically a JSON object. Also called NDJSON (Newline Delimited JSON). It's used for log files, streaming API responses, data pipelines, and machine learning datasets because each line can be processed independently.
What is the difference between JSONL and JSON?
Standard JSON wraps everything in a single object or array. JSONL has one JSON value per line with no wrapping container. JSONL is better for streaming and large datasets since you can process one record at a time without loading the entire file.
Can I convert JSONL to a JSON array?
Yes. Use the 'Convert to JSON Array' button to wrap all lines into a single JSON array. You can also convert a JSON array back to JSONL with the 'JSON Array to JSONL' button.
What happens with invalid JSON lines?
Invalid lines are highlighted in red in the output with an error message indicating which line and what the parse error was. Valid lines are formatted normally.
What is the Pretty mode vs Compact mode?
Pretty mode expands each JSON object with indentation for readability. Compact mode keeps each JSON object on a single line (minified per-line) which is the standard JSONL format suitable for log files and pipelines.