Chat Tokenizer

Estimate chat prompt tokens with role-aware formatting for system, user, assistant, and tool messages. Use this page to simulate full conversations and optimize context windows before sending requests.

Chat Conversation Editor

Build a conversation to see how OpenAI tokenizes chat messages with special formatting tokens

Chat Messages

MESSAGES3
MODECHAT
// HAPPYTOKENIZER: ADD MESSAGES TO SEE TOKENS

Why Use The Chat Tokenizer?

  • Model complete conversations before hitting token limits.
  • Compare how different models price the same chat history.
  • Tune system prompts and message counts for lower latency and cost.

Chat Tokenizer FAQ

How does chat token counting differ from plain text token counting?

Chat token counting includes role and message formatting tokens that are added by chat APIs, so totals differ from plain text estimates.

Can I model a full conversation before sending it to an API?

Yes. You can build multi-message prompts in the chat editor and inspect token totals before calling production endpoints.