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:
CommentsPaste 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.
{"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
- 1Paste your CSV or TSV (first row = column headers).
- 2Map columns to roles: either prompt + completion, or system + user + assistant.
- 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
Token Counter
Count tokens in your prompt for GPT-4, GPT-3.5, Claude, and Gemini and predict API cost before you spend. Free, no signup — all counting runs locally, your prompt stays in your browser.
LLM JSON Extractor
Extract every JSON object or array buried inside an LLM reply — even when it's wrapped in markdown fences, mixed with explanation text, or has trailing commas and single quotes. Auto-repairs each block. 100% local.
Context Window Checker
Check whether your prompt fits a model's context window before you send it. Estimates prompt tokens, reserves room for the response, and shows remaining headroom across GPT-4o, o1, Claude, Gemini, DeepSeek and more. 100% local.
Prompt Token Breakdown
Break a prompt into segments and see how many tokens — and how much cost — each part uses. Find the heaviest section (system, few-shot examples, or user input) so you know exactly what to trim. 100% local.
Schema → Tool Definition
Turn a sample JSON payload into function-calling / tool definitions for OpenAI, Anthropic, and Gemini — side by side. Strict-mode toggle adds required + additionalProperties: false. 100% local, paste straight into your tools array.
Chat Messages Validator
Validate a Chat Completions messages array before you send it — checks roles (system/user/assistant/tool), required content, and common mistakes that cause a 400. 100% local.