ChatML Message Builder

Build a messages array in your browser

Add, remove, and reorder chat turns. Each turn has a role (system, user, or assistant) and content. Export a valid OpenAI-style and Anthropic-style messages array with a rough token estimate. Everything runs locally.

All processing happens locally. Nothing is sent to any server.
OpenAI-style messages

  
Anthropic-style messages

    
Rows: 0
Characters: 0
Approx tokens: 0

Token count is a rough estimate (about 4 characters per token). Real tokenizers differ by model.