Git Diff Token Counter

Tokens
0
Files
0
Added
+0
Removed
-0

Paste a git diff to see per-file token breakdown, cost estimates, and chunking suggestions.

What This Tool Does

Git Diff Token Counter is built for deterministic developer and agent workflows.

Paste a git diff and see token counts per file, cost across AI models, and chunking suggestions when diffs exceed context limits.

Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

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.

How to Use Git Diff Token Counter

  1. 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. 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. 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. 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.

Frequently Asked Questions

What is Git Diff Token Counter?
Git Diff Token Counter parses unified diff format, shows token counts per file, calculates the cost of sending the diff to various AI models for code review, and suggests chunking strategies when diffs exceed context limits.
How accurate are the token estimates?
Token counts use a chars/4 heuristic that closely approximates most tokenizers. For exact counts, use a model-specific tokenizer, but this estimate is reliable for cost planning.
Is Git Diff Token Counter free?
Yes. Completely free with no account or sign-up required.
Does it send my code diffs to a server?
No. All parsing happens entirely in your browser. Your code changes never leave your device.
What is chunking and when do I need it?
When a diff exceeds a model's context window, the tool suggests splitting files into groups that each fit within the limit. This lets you send the diff for AI review in multiple passes.