Git Diff Token Counter
Paste a git diff and see token counts per file, cost across AI models for code review, and chunking suggestions when diffs exceed context limits.
Git Diff Token Counter
702 tokens across 3 files
Per-file breakdown
| File | + | - | Tokens | % |
|---|---|---|---|---|
| src/hooks/useAuth.ts | +29 | -0 | 240 | 34.2% |
| src/components/Button.tsx | +11 | -5 | 231 | 32.9% |
| src/utils/format.ts | +20 | -3 | 231 | 32.9% |
Cost estimates (input)
| Model | Cost | Fits? |
|---|---|---|
| claude-fable-5-1 | $0.0070 | Fits in context window |
| claude-opus-5-5 | $0.0028 | Fits in context window |
| claude-sonnet-5-5 | $0.0014 | Fits in context window |
| claude-haiku-4-5 | $0.0007 | Fits in context window |
| gpt-6-astra | $0.0070 | Fits in context window |
| gpt-6.1-sol | $0.0014 | Fits in context window |
| gpt-6-luna | $0.0000 | Fits in context window |
| gpt-5.5 | $0.0035 | Fits in context window |
| gpt-5.4-mini | $0.0005 | Fits in context window |
| gemini-3.8-flash | $0.0005 | Fits in context window |
| gemini-3.5-flash-lite | $0.0002 | Fits in context window |
| gemini-3.1-pro-preview | $0.0014 | Fits in context window |
| deepseek-flash | $0.0002 | Fits in context window |
| deepseek-v4-pro | $0.0009 | Fits in context window |
| grok-4.7 | $0.0014 | Fits in context window |
| grok-4.3 | $0.0009 | Fits in context window |
| mistral-medium-3504 | $0.0011 | Fits in context window |
| mistral-small-2603 | $0.0001 | Fits in context window |
| mistral-large-2512 | $0.0004 | Fits in context window |
| muse-spark-1.3 | $0.0009 | Fits in context window |
| qwen3.8-max | $0.0014 | Fits in context window |
| qwen3.8-flash | $0.0001 | Fits in context window |
| openai/gpt-oss-120b | $0.0001 | Fits in context window |
With system prompt overhead (~2,000 tokens), actual cost is slightly higher. Token counts use a chars/4 heuristic; actual tokenization varies by model. Prices are input-only (the diff is sent as input).
What this tool does
Paste a git diff into the Git Diff Token Counter to see token counts per file and the estimated cost of an AI code review across GPT, Claude, and other models. When a diff is larger than a model's context window, it suggests where to chunk it so large reviews still fit. It runs privately in your browser.
Updated . Provided as is. Check the output before you rely on it in production.
How to use Git Diff Token Counter
- 1
Paste your git diff
Run git diff in your terminal and paste the output. The tool parses unified diff format and extracts per-file changes.
- 2
Review per-file breakdown
See each modified file with its addition and deletion counts, token count, and percentage of the total diff. Files are sorted by token count.
- 3
Check model costs
The cost table shows what it would cost to send this diff to various AI models for code review, with context-fit indicators showing which models can handle the full diff.
- 4
Apply chunking suggestions
If your diff exceeds any model's context window, the tool suggests how to split files into groups that each fit within the limit for multi-pass review.
Questions and answers
What is Git Diff Token Counter?
How accurate are the token estimates?
Does it send my code diffs to a server?
What is chunking and when do I need it?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/git-diff-token-counter/
For automation planning, fetch the canonical contract at /api/tool/git-diff-token-counter.json.