A powerful token counter and cost calculator for LLM APIs. Compare pricing across OpenAI, Anthropic, Google, Mistral, AWS Bedrock, Qwen, and more.
- Real-time Token Counting: Accurate token counting using js-tiktoken for OpenAI models
- Multi-Provider Support: Compare costs across 50+ models from major providers
- Live Pricing Data: Fetches current pricing from LiteLLM's maintained database
- Usage Projections: Estimate daily and monthly costs based on your usage patterns
- Input & Output Analysis: Calculate tokens for both prompts and expected responses
- Light & Dark Mode: Automatically detects system preference with manual toggle
- Privacy First: All calculations happen client-side, no data sent to servers
| Provider | Models |
|---|---|
| OpenAI | GPT-4.1, GPT-5, GPT-5.4, o1, o3, o4-mini, Codex |
| Anthropic | Claude 3.5, Claude 4, Claude 4.6 Opus/Sonnet |
| Gemini 2.5, Gemini 3, Gemini 3.1 Flash/Pro | |
| AWS Bedrock | Nova, Nova 2, Titan Text, Titan Multimodal |
| Mistral | Large, Small, Codestral, Pixtral |
| Qwen | QwQ, Qwen 2.5, Qwen VL |
| DeepSeek | V3, R1, Coder V2 |
| Meta | Llama 4, Llama 3.3 |
| Groq | Fast inference models |
| xAI | Grok 2 |
| Cohere | Command R+ |
| AI21 | Jamba 1.5 |
# Clone the repository
git clone https://github.com/BOTOOM/llm-token-calculator.git
# Navigate to the project
cd llm-token-calculator
# Install dependencies
pnpm install
# Start development server
pnpm devOpen http://localhost:3000 to see the calculator.
- Paste your prompt in the input area (or enter token count directly)
- Optionally add expected output to calculate total tokens
- View token counts across different providers
- Configure usage (requests/day, active days)
- Filter models by capabilities (vision, reasoning, coding, etc.)
- Compare costs in the interactive table
Total Cost = (Input Tokens * Input Rate) + (Output Tokens * Output Rate)
- Next.js 16 - React framework
- Tailwind CSS - Styling
- shadcn/ui - UI components
- js-tiktoken - Token counting
- LiteLLM - Pricing data source
- next-themes - Theme management
Contributions are welcome! Please read our Contributing Guide and Code of Conduct first.
For security issues, please see our Security Policy.
If you find this tool useful, consider supporting its development:
This project is licensed under the MIT License - see the LICENSE file for details.
Pricing data from LiteLLM