RealJSON
Try now

Fine-Tuning Dataset Validator (JSONL)

Check an OpenAI, DPO or Anthropic Claude training file line by line before you upload it — format, roles, weights, duplicates and size.

Format

Training data (JSON Lines)

Report

Paste a .jsonl training file or open one to check it.

In short: Fine-tuning jobs reject a whole file for one bad line, often after a slow upload. This validator checks every example of an OpenAI (chat or DPO), Anthropic Claude (Amazon Bedrock) or prompt/completion dataset in your browser and lists each problem with its line number, plus counts, duplicates and a token estimate.

Validate fine-tuning data before you upload

Training files are JSON Lines: one complete JSON object per line, each a separate example. A generic JSON validator cannot check them, and the provider only tells you something is wrong after the upload. Paste the file or open it here and you get a line-by-line report in seconds.

The format is detected from the first example. If the file is a JSON array, convert it with the JSONL converter first; if a model generated your examples and some lines are broken, fix them with JSON Repair.

What gets checked

Structure

Every line must parse as a JSON object with the keys its format requires — messages, input/preferred_output/non_preferred_output, or prompt/completion. Unknown keys are flagged as warnings.

Roles and turns

Roles must be valid for the provider, each conversation needs an assistant reply to learn from, and Claude conversations must alternate user → assistant and keep the system prompt in the top-level system field.

Content and weights

Empty messages, content that is neither text nor content parts, weight values other than 0 or 1, and weights on non-assistant messages are reported.

Dataset health

Duplicate examples, too few examples for OpenAI (minimum 10), the longest example and an approximate token count help you catch data and cost problems early.

Frequently Asked Questions

What format does OpenAI fine-tuning expect?

A JSON Lines file where every line is one example: {"messages": [...]} with system/developer, user and assistant messages (plus tool messages and a "tools" list for function calling). Each example needs at least one assistant message, and OpenAI requires at least 10 examples.

What is the Anthropic / Amazon Bedrock format for Claude fine-tuning?

Each line holds an optional top-level "system" string and a "messages" array whose roles alternate user → assistant, starting with user and ending with assistant. A system message inside "messages" is rejected — the checker flags it.

What does the DPO (preference) format look like?

Each line has "input" (with a "messages" array) and two single-message arrays, "preferred_output" and "non_preferred_output", each containing one assistant reply. Identical preferred and non-preferred outputs are reported as an error.

Why does my upload fail with "invalid file format"?

The usual causes are a JSON array instead of one object per line, a line with a trailing comma or unescaped quote, a misspelled role, a conversation with no assistant reply, or "weight" on a non-assistant message. Every one of these is reported here with its line number.

How accurate is the token estimate?

It is a rough characters ÷ 4 estimate across all message text, good for spotting unusually long examples and ballparking cost. Providers count with their own tokenizers, so treat it as approximate.

Is my training data uploaded anywhere?

No. The file is read and checked in your browser; nothing is sent to RealJSON or to any model provider.

Related Tools

JSONL / NDJSON Converter · JSON Repair · JSON to JSON Schema · JSON Schema Validator

Browse all free JSON tools →

Related tools