Chat Format Converter
Convert a fine-tuning dataset between chat formats. OpenAI chat, Anthropic messages, ShareGPT, Alpaca, Gemini and legacy prompt/completion — pick a target and the source format is detected per line. Up to 1 GB, in your browser.
Convert
How each format maps
Every record is normalised into a neutral shape — an optional system prompt plus an ordered list of user / assistant turns — and then re-emitted in the target format. That is why any source converts to any target without n×n special cases.
- OpenAI chat —
{"messages": [{"role": "system|user|assistant", "content": "…"}]}. The system prompt lives inside the array. - Anthropic messages —
{"system": "…", "messages": [{"role": "user|assistant", …}]}. The system prompt is a sibling ofmessages, not a message. Roles must alternate. - ShareGPT —
{"conversations": [{"from": "human|gpt", "value": "…"}]}. The community format behind most Axolotl and LLaMA-Factory recipes;fromvalues vary (gpt,assistant,chatgpt,botare all read as assistant). - Alpaca —
{"instruction": "…", "input": "…", "output": "…"}. Single-turn. On the way in,inputis appended toinstructionas the user turn. - Gemini —
{"contents": [{"role": "user|model", "parts": [{"text": "…"}]}]}. Notemodelrather thanassistant. - prompt / completion — OpenAI's deprecated pair. Converting into it folds the system prompt into
prompt.
Where multi-turn data gets lost
Only two of these formats are single-turn. Converting a three-exchange conversation into Alpaca or prompt / completion cannot preserve it — the tool keeps the first user turn and the first assistant turn, and the status bar turns amber telling you how many records were affected.
If your data is multi-turn, target one of the chat formats. If you must produce Alpaca, consider splitting conversations into one record per exchange first rather than silently dropping context.
Validate after converting
Conversion gets the shape right; it does not guarantee the provider will accept the file. Run the result through the matching validator — OpenAI, Anthropic, Gemini, Llama or Mistral — which check role alternation, empty content, token limits and the provider-specific rules this converter deliberately stays out of.
Privacy
Nothing is uploaded. The whole thing runs in this tab, in your own browser. That matters here more than on most tool sites — training data is usually the most sensitive file a team owns.
Frequently asked questions
Why did some lines get skipped?
Their shape did not match any known format — often because they are already flat records rather than conversations, or a key is spelled differently. Set From explicitly instead of Auto-detect, and check the skipped count in the status bar.
Does it preserve tool calls and function definitions?
No. The neutral shape carries text turns only, so tool_calls, function_call and typed content blocks are flattened to their text or dropped. If your dataset uses tool calling, convert by hand or keep the original format.
What happens to multiple system messages?
They are concatenated with newlines into a single system prompt, since every target format allows at most one.
Can I convert several formats in one file?
Yes — with Auto-detect, each line is examined on its own, so a mixed file converts cleanly and the status bar lists the counts per detected format.