01What is Fine-tuning JSONL Validator?
A fine-tuning job can fail after upload because one line in a large file is malformed. This validator checks a chat-format JSONL file in your browser before you send it, and reports problems by line number. OpenAI's fine-tuning guide says the file uses JSONL, with one complete JSON object on every line, in the chat completions format. It also says you need at least 10 examples. The per-line checks follow OpenAI's data preparation cookbook. Each line must parse as JSON and be an object with a messages array. Every message needs a role and content. Recognized roles are system, user, assistant and function, and the tool also accepts tool, because the fine-tuning guide shows tool-calling examples. Recognized message keys are role, content, name, function_call and weight, plus tool_calls and tool_call_id for tool calls. Any other key or role is an error. Empty content is an error, except on an assistant message that makes a tool call. A line with no assistant message is an error, since there is nothing for the model to learn. Some checks are warnings rather than errors. They flag a conversation that starts with an assistant turn, a system message after the first position, two user messages in a row, and a last message that is not from the assistant. The file-level notes count examples against the minimum of 10 and point out blank lines in the middle of the file. The token count is an estimate. The cookbook counts tokens with the cl100k_base tokenizer, adding 3 per message and 3 per example. This tool has no tokenizer, so it divides text length by four and adds the same overheads. Use the numbers to spot outliers, not for billing. Lines over the cookbook's 16,385 token limit get a warning, since they would be truncated. The tool does not check tools definitions, function argument schemas or model-specific rules such as vision or preference formats. Your data never leaves your browser.
Developers and ML engineers preparing chat fine-tuning datasets who want to catch format errors before a job fails. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Fine-tuning JSONL Validator
- Paste your JSONL file into the input box, or pick an example
- Read the summary line for the count of examples, errors and warnings
- Tick Only problems to hide lines that passed
- Fix each flagged line in your file using its line number
- Copy the report if you want to share it or track fixes
03Worked examples
- Input:
{"messages":[{"role":"system","content":"You are terse."},{"role":"user","content":"Capital of France?"},{"role":"assistant","content":"Paris."}]} - Result:
Line 1 (~29 tokens): OK Only 1 example. OpenAI requires at least 10. - A well-formed chat example passes, but the file-level check reminds you that OpenAI needs at least 10 lines.
- Input:
{"messages":[{"role":"system","content":"You are terse."},{"role":"user","content":"Capital of France?"},{"role":"assistant","content":"Paris."}]} {"messages":[{"role":"bot","content":""},{"role":"assistant","content":"x","extra":1}]} {"messages":[{"role":"user","content":"Hi"}]} {"prompt":"old format","completion":"x"} - Result:
Line 1 (~29 tokens): OK Line 2: Message 1: unrecognized role "bot". Message 1: content is empty. Message 2: unrecognized key "extra". First message after the system prompt is "bot", usually it is "user". Line 3: No assistant message, so there is nothing for the model to learn from. Last message is not from the assistant. Line 4: Missing "messages" array. 3 errors - Each line is checked on its own. The last line uses the old prompt/completion format, which the chat format does not accept.
- Input:
{"messages":[{"role":"user","content":"Weather in Paris?"},{"role":"assistant","tool_calls":[{"id":"call_1","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"Paris\"}"}}]},{"role":"tool","tool_call_id":"call_1","content":"18C, cloudy"},{"role":"assistant","content":"18C and cloudy."}]} - Result:
Line 1 (~63 tokens): OK Only 1 example. OpenAI requires at least 10. - An assistant message may have tool_calls instead of content, and a tool message answers it with tool_call_id.
- Input:
{"messages":[{"role":"user","content":"Translate: hello"},{"role":"assistant","content":"hola","weight":0},{"role":"user","content":"More formal"},{"role":"assistant","content":"Buenos dias","weight":1}]} {"messages":[{"role":"user","content":"Hi"},{"role":"assistant","content":"Hel - Result:
Line 1 (~34 tokens): OK Line 3: Invalid JSON: Unterminated string in JSON at position 78 (line 1 column 79) 1 blank line inside the file. Remove them; each line should hold one example. - weight 0 on an assistant message is allowed and skips it during training. A cut-off line and a blank line are both reported.
04Common use cases
- Checking a training file before uploading it to a fine-tuning job
- Finding which line of a large JSONL export has broken JSON
- Catching examples that have no assistant reply
- Spotting typos in role names such as bot or AI
- Finding unusually long examples by their rough token count
05Tips
- Each example must sit on one line, so pretty-printed JSON will fail
- Fix errors first; warnings point at examples that are allowed but unusual
- The token count is approximate, so use a real tokenizer for exact numbers
- Old prompt and completion files are a different format and will fail the messages check
06Related concepts
JSONL, fine-tuning, chat completions format, training data, token count.
Frequently Asked Questions
What is Fine-tuning JSONL Validator?
Fine-tuning JSONL Validator is a free, browser-based developer tool on AIDToolStack. Validate chat-format fine-tuning JSONL in your browser: JSON syntax, messages array, roles, empty content, assistant turns and rough token counts per line. It requires no installation or sign-up and works entirely in your browser.
Is Fine-tuning JSONL Validator free to use?
Yes. No sign-up, no fees and no usage cap.
Does Fine-tuning JSONL Validator store my data?
No. It runs in your browser; nothing is uploaded.