Chat Prompt Format Converter
Converts a conversation between OpenAI messages, Anthropic, Gemini, ChatML, Llama 2, Llama 3, Mistral and plain transcript formats, from JSON or from simple System: and User: lines.
Use the tool
Why this tool exists
Every model family wants the same conversation written differently. OpenAI takes a messages array, Anthropic splits out the system prompt, Gemini uses contents and parts, and open models expect special tokens such as <|im_start|> or [INST]. Moving a prompt between them by hand is a source of subtle bugs, like a missing end token or a system message in the wrong place. Paste a conversation in any of the supported JSON shapes, or as plain lines starting with System:, User: and Assistant:, and choose the target. The templates follow each family's published chat format, but individual models can vary slightly, so check against your model's own template. Everything is converted in your browser.
How to use it
- Paste the conversation as JSON in an OpenAI, Anthropic or Gemini shape, or as System:/User:/Assistant: lines.
- Choose the target format and tick "Append generation prompt" if the assistant turn should be left open.
- Copy the converted prompt.
Frequently asked questions
Which formats can it read?
OpenAI-style message arrays, Anthropic objects with system and messages, Gemini contents with parts and systemInstruction, and plain text lines starting with a role name. Roles like human, ai and model are normalised.
Are the special-token templates exact?
They follow the commonly published templates for ChatML, Llama 2, Llama 3 and Mistral. Fine-tunes and newer versions sometimes differ, so verify against the tokenizer's chat template for your exact model.
What does the generation prompt option do?
It adds the opening of an assistant turn, such as <|im_start|>assistant, so the model continues from there. Turn it off if you are only storing the conversation.
What happens to the system message?
It stays as a system message for OpenAI and ChatML, becomes the system field for Anthropic, goes to systemInstruction for Gemini, and is merged into the first user turn for Llama 2 and Mistral.