tokenx is by johannschopplich β not by us.
We indexed this project so people can find it. We are not selling it, we host no copy of the code, and we are not affiliated with or endorsed by its authors β get it from them.
Indexed Oct 5, 2026 Β· 179 stars at index time. Maintainers: claiming verifies your identity and unlocks a higher assurance tier. Removal requests are honored.
Application Β· for humans & their agents
tokenx
unclaimed listingactively maintainedFreeMIT
π Fast token estimation with 95%+ average accuracy in a 2kB bundle
by Open Source Community Β· New publisher
Every claim on this page is refundable if it is untrue β refund policy.
π Fast token estimation with 95%+ average accuracy in a 2kB bundle
johannschopplich/tokenx is an open-source project by johannschopplich: π Fast token estimation with 95%+ average accuracy in a 2kB bundle. Indexed here so it can be found β not resold.
It is free. Get it from the upstream repository: https://github.com/johannschopplich/tokenx
From the project's own README (excerpt, reproduced for discovery under its MIT license):
tokenx
Fast and lightweight token count estimation without requiring a full tokenizer.
Estimates are calibrated against OpenAI's o200kbase encoding β the tokenizer of all current GPT models. Counts for other LLM families will differ somewhat; the defaultCharsPerToken and languageConfigs options let you tune the heuristics for your model. For precise counts, use a full tokenizer like gpt-tokenizer.
Features β’ β‘ 95%+ average accuracy, and no single sample below 90% β’ π¦ Just 2kB bundle size with zero dependencies β’ π₯οΈ Bundled CLI β count, slice and split from the shell β’ π Multi-language support with configurable language rules β’ π£οΈ Built-in rules for accented scripts (German, French, Spanish, Slavic), Cyrillic, and Greek β’ π CJK (Chinese, Japanese, Korean) character handling β’ π Emoji-aware pricing (emoji cost more tokens than their character count suggests)
Benchmarks
The following chart shows how close the estimates come to actual GPT token counts for different input texts:
Bars grow left when tokenx underestimates and right when it overestimates. The axis spans the Β±10% per-sample deviation bound.
Accuracy depends on the kind of text, not its length: a short excerpt deviates about as much as the full document it came from. A holdout corpus that no ratio was ever fitted against is held to a looser Β±15% bound, so a retune cannot silently overfit the chart.
Three cases are knowingly outside these bounds, all underestimates: β’ High-entropy strings β base64, hashes, digests: β-70%. Pricing them would cost every caller runtime for a case ordinary traffic rarely carries. β’ Traditional and classical Chinese β the hanzi rate is calibrated on contemporary simplified script: β-10% to -20%. β’ Scripts without a built-in rule β Arabic β-35%, Hindi β-30%,β¦
01Capabilities
Does
- No capabilities recorded
Doesnβt
- No exclusions declared
02Requirements & stack
Depends on
No declared dependencies
Credentials needed
None declared
Stack
03Community
No endorsements yetNo verified confirmations yet β be the first.
Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality β security is verified separately, and community votes can never override the security gate.
Sign in to confirm β weight comes from verified usage, not vote count.
Issues 0
Open an issueNobody has reported anything yet β a success counts as a report too.
04Trust Passport
Full passport β0/0 automated components pass. An automated score is never a security guarantee.
This listing is unclaimed, so publisher identity cannot be verified and it stays below the βverifiedβ tier by design β that is a statement about the listing, not about the projectβs quality. Our automated scans still ran; a maintainer who claims it unlocks identity verification.
05Versions
Full history β| Version | Channel | Released | Notes |
|---|---|---|---|
| 0.0.0 | stable | Oct 5, 2026 | Indexed listing β see the upstream repository for real release history. |