JSONL → OpenAI Fine-Tuning Converter

Convert your data to OpenAI fine-tuning format with validation.

Paste prompt/completion pairs or chat turns and convert them to the exact chat JSONL schema OpenAI requires for fine-tuning. Validates roles, message structure, and minimum example count before you upload. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What format does OpenAI require for fine-tuning?

The chat fine-tuning format is JSONL where each line is an object with a messages array, e.g. {"messages":[{"role":"system","content":"..."},{"role":"user","content":"..."},{"role":"assistant","content":"..."}]}. Each line is one complete training example, and the assistant message is the target the model learns to produce.

Build a valid fine-tuning file in seconds

OpenAI’s chat fine-tuning endpoint expects a precise JSONL shape: one JSON object per line, each containing a messages array with system, user, and assistant roles in the right order. A single malformed line causes the entire upload to fail with a validation error, often without a clear indication of which line is wrong. This tool takes your raw prompt/completion pairs or chat turns and converts them to exactly that schema, validating roles and example counts before you ever hit the API.

The required format

Each line of the JSONL file must be a complete, self-contained JSON object on a single line. OpenAI’s format for chat fine-tuning is:

{"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"What is the capital of France?"},{"role":"assistant","content":"Paris."}]}

Every line is one training example. The assistant message is the target the model learns to produce. Multiple user/assistant turns are allowed in one example to teach multi-turn conversation. The system message is optional per example — this tool lets you set one system prompt that is applied to every example automatically.

How the converter works

Choose your input mode:

  • Pair mode — paste one example per line, prompt and completion separated by a tab or a pipe (|). The tool maps the prompt to a user message and the completion to an assistant message, wraps each in the required messages array, and emits one JSONL line per example.
  • Structured mode — paste arrays of message objects you have already shaped. The tool validates structure and serializes each to a single line.

After converting, the validation panel checks:

  • Every example ends with an assistant turn (required by the API)
  • All roles are from the allowed set (system, user, assistant)
  • You have at least the ten-example minimum before uploading

Worked example

Two training pairs in pipe-separated mode:

Translate to Spanish: "Hello" | Hola
Translate to Spanish: "Thank you" | Gracias

With system prompt You are a Spanish translator. produces:

{"messages":[{"role":"system","content":"You are a Spanish translator."},{"role":"user","content":"Translate to Spanish: \"Hello\""},{"role":"assistant","content":"Hola"}]}
{"messages":[{"role":"system","content":"You are a Spanish translator."},{"role":"user","content":"Translate to Spanish: \"Thank you\""},{"role":"assistant","content":"Gracias"}]}

Upload this file with the OpenAI Files API, get back a file ID, and pass it to a fine-tuning job to train a model on your data.

Practical guidance

Volume. OpenAI requires a minimum of ten examples but quality results usually need fifty to a few hundred curated pairs. More is not always better — noisy, inconsistent examples degrade the model. Prioritize consistency over volume.

System prompt consistency. Whatever system prompt you use during training must match what you send at inference time. The model learns behavior in the context of that instruction; a mismatch at inference can cause the fine-tuned style to fail.

Edge cases the validator catches. Missing assistant turns, unrecognized roles (user2, human), and examples that are entirely user-only will all fail the OpenAI upload validation. This tool catches them first so you can fix before uploading.

Privacy. Everything runs locally in your browser. Training data never leaves the page, making it safe to use with proprietary or sensitive examples before you decide to upload to OpenAI.