DevKits

Fine-tuning JSONL Converter — Build OpenAI Chat JSONL from a Table

Turn a CSV / TSV of prompt-completion pairs (or system/user/assistant columns) into a valid OpenAI fine-tuning JSONL file — one chat example per line. Validates roles and shows token estimates. 100% local.

Last updated:

Comments

Paste a CSV or TSV of your training rows, map which columns are the system / user / assistant (or prompt / completion) messages, and this tool emits a valid OpenAI fine-tuning JSONL — one {"messages":[…]} object per line — with role validation and a token estimate. Everything runs in your browser.

Examples: 3Tokens: …
fine-tuning.jsonl
{"messages":[{"role":"user","content":"What is the capital of France?"},{"role":"assistant","content":"The capital of France is Paris."}]}
{"messages":[{"role":"user","content":"Convert 10 km to miles."},{"role":"assistant","content":"10 km is about 6.21 miles."}]}
{"messages":[{"role":"user","content":"Who wrote Hamlet?"},{"role":"assistant","content":"Hamlet was written by William Shakespeare."}]}

Parsing and conversion run entirely in your browser — your data is never uploaded. Token counts use OpenAI’s o200k_base tokenizer.

What is Fine-tuning JSONL?

OpenAI fine-tuning expects a JSONL file: one JSON object per line, each of the form {"messages": [{"role":"system",...}, {"role":"user",...}, {"role":"assistant",...}]}, where the assistant message is the completion the model should learn. Hand-building that from a spreadsheet of examples is tedious and error-prone — a stray quote or a missing assistant turn breaks the upload. This converter parses your CSV/TSV, lets you map columns to roles (either a prompt/completion pair or explicit system/user/assistant columns), escapes everything correctly, and writes clean JSONL. It validates that every example has a user and an assistant message, counts the examples, and estimates total tokens so you can gauge training cost before you upload.

How to build a fine-tuning JSONL file

  1. 1Paste your CSV or TSV (first row = column headers).
  2. 2Map columns to roles: either prompt + completion, or system + user + assistant.
  3. 3Copy or download the generated JSONL and upload it to the fine-tuning API.

Key Concepts

JSONL
JSON Lines — one JSON object per line. Validate an existing file separately.
messages array
Each training line wraps a chat messages array; the assistant turn is the target.
Token estimate
Rough training-token total; use the Token Counter for exact per-example counts.

Tips & Best Practices

  • ▸Keep examples consistent in style and format — fine-tuning learns patterns, so noise in, noise out.
  • ▸Aim for 50–100+ high-quality examples; 10 is the minimum but rarely enough.

Frequently Asked Questions

What format does OpenAI fine-tuning need?

A JSONL file — one JSON object per line — where each line is {"messages": [{"role":"system",...},{"role":"user",...},{"role":"assistant",...}]}. The assistant message is the target the model learns to produce. This tool builds exactly that shape from your tabular data.

Can I convert prompt / completion columns?

Yes. If your CSV has prompt and completion columns, each row becomes a user message + assistant message. If it has system/user/assistant columns, all three are included. You pick which columns map to which role.

How many examples do I need to fine-tune?

OpenAI requires at least 10 examples, but 50–100+ high-quality, consistent examples usually give meaningfully better results. The tool shows the example count and a rough token total so you can estimate training cost.

Is my data uploaded?

No. The CSV is parsed and the JSONL is built entirely in your browser.

Try Next

Text Chunker

Split long text into overlapping chunks for embedding and RAG pipelines. Preview recursive, paragraph, sentence, or fixed strategies with live token counts. Runs 100% in your browser.

Related Tools

Reference & Guides