Analyze a conversation’s structure and token balance
The Conversation Turn Counter & Analyzer takes a chat messages array and
breaks down its shape: how many turns, the split between user and assistant,
approximate tokens per turn, and which individual turns are unusually long. It is
a quick health check before you send a transcript to a model or store it as
training data.
How it works
The tool parses your JSON and reads each message’s role and content. String
content is used directly; array content (Anthropic-style content blocks) has its
text parts concatenated. Tokens are estimated with a character-based heuristic of
roughly four characters per token — fast and good enough to compare turns and
catch outliers. It then computes totals, the user/assistant ratio, the average
tokens per turn, and flags any turn far above that average.
Tips and notes
Use this to sanity-check transcripts before fine-tuning or evaluation: a healthy dialogue usually alternates roles with reasonably balanced lengths. A single giant turn is a candidate for summarization so it does not crowd the context window on the next call. The token figures are estimates for structural insight, not billing — pair this with the OpenAI or Anthropic usage parsers when you need exact counts. Everything runs locally; nothing you paste leaves the browser.