Zero Signup ToolsFree browser tools

Developer Tools

JSON Lines Formatter

Format, validate, and convert JSON Lines (NDJSON) files in your browser. Per-line error reporting, JSONL to JSON array, and JSON array to JSONL.

JSON Lines (NDJSON) formatter and validator

Mode

Check every line and list any errors with line numbers.

0 B
Try:

What JSON Lines is

  • JSON Lines (also called NDJSON or LDJSON) is plain text where each line is a complete, independent JSON value separated by a newline.
  • Every line must stand on its own. A pretty-printed JSON object split across many lines is not valid JSON Lines, even if every brace matches.
  • The conventional file extensions are .jsonl and .ndjson. The MIME type used by most pipelines is application/x-ndjson.
  • Trailing newlines are expected by most tools. Leading UTF-8 BOMs and Windows CRLF endings are common in real files and are handled automatically here.

Common use cases

  • Fine-tune training data for OpenAI and Anthropic. Each line is one training example, usually an object with a messages array.
  • Structured logs from Vector, Fluentd, Filebeat, Loki, and Promtail. Each log record is a single line, easy to tail and grep.
  • Bulk imports and exports for BigQuery, Athena, and Snowflake. JSON Lines is the wire format for streaming row data.
  • HTTP streaming responses where the server emits one event per line so the client can parse them incrementally.

How to use

  1. Pick a mode: Validate to check the file, Format to rewrite it as one record per line, To JSON array to combine records into a JSON array, or From JSON array to convert a JSON array into JSONL.
  2. Paste your JSONL into the input area, or click a sample button (server logs, OpenAI fine-tune, BigQuery export, with bad lines) to see the tool working.
  3. Read the status banner and the stats panel for record count, error count, blank lines, total lines, sizes, top-level type breakdown, BOM, line endings, and trailing newline.
  4. If the error panel appears, fix each line listed (it shows the line number, column where parsing failed, the message, and a short preview), then re-check.
  5. Copy the cleaned output or click Download to save it as output.jsonl or output.json depending on the mode.

About this tool

JSON Lines Formatter parses, validates, and converts JSON Lines (also called NDJSON or LDJSON) entirely in your browser. Each record is one complete JSON value on its own line; the parser walks the input line by line, surfaces any failed records with the exact line and column from the original input, and reports a clean status when every record is valid. Four modes are available: Validate checks every line and lists the bad ones with a parse-error preview; Format rewrites the input as one minified record per line with a trailing newline, which is what tools like BigQuery, Athena, OpenAI and Anthropic fine-tune endpoints, Fluentd, Vector, and Filebeat actually want on disk; To JSON array combines every record into a single JSON array with a configurable indent (0, 2, or 4 spaces) so you can hand the file to something that only understands JSON; From JSON array does the reverse, taking a pretty-printed JSON array and emitting one record per line as JSONL. A stats panel reports record count, error count, blank line count, total line count, input and output size in bytes, the breakdown of top-level types across records, whether the input began with a UTF-8 BOM, whether the file uses CRLF or LF line endings, and whether the file has a trailing newline. Edge cases that trip up JSON parsers in real exports are handled automatically: a leading UTF-8 BOM is stripped, CRLF line endings are normalized to LF, blank lines between records are tolerated, and a missing trailing newline is highlighted in the encoding hints. Sample buttons load real-world shapes (server logs, an OpenAI-style fine-tune file, a BigQuery export, a deliberately broken sample with bad rows) so you can confirm the tool does what you need before pasting your own data. Output can be copied to the clipboard or downloaded as either output.jsonl or output.json depending on the mode. Everything runs locally; the JSON Lines you paste never leaves your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools