JSON Formatter & Validator
Format and validate a single JSON document with error detection.
JSONL (one JSON object per line) is the format for LLM fine-tuning datasets, logs, and data pipelines — and a single bad line breaks the whole file. This tool checks every line independently, reports the exact line number and reason for each problem, and can apply the structural rules for OpenAI chat fine-tuning and Bedrock Claude fine-tuning. It runs entirely in your browser, so your training data never leaves the page.
JSONL — JSON Lines, sometimes called NDJSON — stores one independent JSON object per line. Because each record stands alone, the format is ideal for streaming, appending, and the line-by-line datasets that LLM providers require for fine-tuning. The flip side is that a single malformed line can cause an entire upload to be rejected, often with an unhelpful error, so validating locally before you upload saves a frustrating round-trip.
The single most common error is wrapping the records in a JSON array. A file like [ {"a":1}, {"a":2} ] is valid JSON but is not JSONL, and fine-tuning endpoints reject it. Genuine JSONL has no enclosing brackets and no commas between records — just one object, a newline, the next object, and so on. Other frequent problems are trailing commas, single-quoted strings, unquoted keys, a stray byte-order mark, and blank lines that parse to nothing.
Beyond raw JSON validity, each provider imposes a structure on the records. OpenAI expects a messages array with system, user, assistant, and tool roles and at least one assistant turn per example. Claude fine-tuning, offered through Amazon Bedrock, expects a top-level system field plus a messages array of strictly alternating user and assistant turns that starts with the user and ends with the assistant. This tool encodes those rules so you can catch a structural mistake — not just a syntax error — before you spend time and money on a failed training job.
[ {...}, {...} ]), which is valid JSON but not JSONL — fine-tuning APIs reject it.messages array; each message needs a valid role (system, user, assistant, or tool) and non-empty string content (an assistant message may instead carry tool_calls); each example must contain at least one assistant message (the training target); and an optional weight of 0 or 1 is allowed only on assistant messages. It also warns if you have fewer than 10 examples, OpenAI's documented minimum.messages array with only user and assistant roles, that the conversation starts with a user turn, alternates, and ends with an assistant turn, and that the system prompt lives in a top-level system field rather than a system-role message. It warns below 32 examples, the documented Bedrock Claude 3 Haiku minimum. The published format targets Claude 3 Haiku; newer Claude models are not currently documented as fine-tunable.bot, ai, or human; an example with no assistant message to learn from; or, for Claude, putting the system prompt in a message instead of the top-level system field. This tool flags each of these with the exact line number.