AI token counter

Count tokens and estimate the API cost of a prompt for GPT, Claude, and Gemini models.

Runs in browser

Use from your agent

Streamable HTTP at https://benchline.fabwaseem.com/mcp. No key. The tool name is count_tokens.

mcp.jsonjson
1{
2 "mcpServers": {
3 "benchline": {
4 "url": "https://benchline.fabwaseem.com/mcp"
5 }
6 }
7}
tools/calljson
1{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "method": "tools/call",
5 "params": {
6 "name": "count_tokens",
7 "arguments": {
8 "text": "example",
9 "encoding": "o200k",
10 "modelIds": [
11 "gpt-6.1-sol",
12 "claude-sonnet-5-5",
13 "gemini-4-argon"
14 ],
15 "outputTokens": 0,
16 "cachedRatio": 0,
17 "requestsPerDay": 0
18 }
19 }
20}

How it works

Free LLM token counter and API cost calculator. Paste text to count tokens with OpenAI's tokenizers and estimate input and output cost across GPT, Claude, Gemini, and other models.

  1. 01

    Paste your prompt or file

    Drop a .txt, .md, or .json file, or paste the prompt. The count updates in the browser.

  2. 02

    Pick models and expected output

    Choose the models to compare, set the output tokens you expect back, and the cached-input share.

  3. 03

    Compare cost per request and per month

    The table prices input and output separately. Copy it as markdown when you want to keep the estimate.

FAQ