# huggingface/tokenizers

💥 Fast State-of-the-Art Tokenizers optimized for Research and Production

Repository: https://github.com/huggingface/tokenizers
Canonical: https://ross.abutalabs.com/products/tokenizers
Homepage: https://huggingface.co/docs/tokenizers
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: nlp, natural-language-processing, natural-language-understanding, language-model, transformers, bert, gpt
Last push: 2026-08-26T16:26:22+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 81, longevity 100
- inputs: {"age_days": 2497, "days_push": 7, "days_rel": 128, "gap_med": 25, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10997, forks 1177 (observed 2026-08-28T04:10:44.983948+00:00)

## What it is
Hugging Face Tokenizers is a fast, Rust-based library implementing state-of-the-art tokenization algorithms (BPE, WordPiece, Unigram) with bindings for Python, Rust, and Node.js. It handles the full tokenization pipeline including normalization, pre-tokenization, training new vocabularies, and pre-processing like padding, truncation, and special token handling.

## Use cases
- train a BPE tokenizer on my own corpus
- tokenize text for a transformer model
- convert text to token ids for BERT or GPT
- build a custom vocabulary for a language model
- fast tokenization of large text datasets
- map tokens back to original text offsets
- pad and truncate sequences for model input

## When to choose
- you need extremely fast tokenization or vocabulary training (GBs of text in seconds)
- you are training or fine-tuning transformer models and need consistent tokenization
- you need alignment tracking to map tokens back to original text
- you want the standard tokenizer used by the Hugging Face Transformers ecosystem

## When to avoid
- you need a general-purpose text segmentation tool unrelated to ML models
- you only need simple whitespace splitting or regex tokenization
- you need subword tokenization for a language/model family with incompatible requirements

## Facets
- artifact type: library
- maturity: stable
- function: nlp, parser, machine-learning, sdk
- domain: machine-learning, large-language-models, developer-tools
- platform: rust, python, cross-platform
- tags: tokenizer, bpe, wordpiece, unigram, hugging-face, transformers, text-preprocessing, natural-language-processing, nodejs

## Member repositories
- huggingface/tokenizers (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:44.983948+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:17:14.628665+00:00, confidence not recorded.
  - readme: https://github.com/huggingface/tokenizers (fetched 2026-08-28T04:10:44.983948+00:00, sha 881ffd60cc27)
  - homepage: https://huggingface.co/docs/tokenizers (fetched 2026-08-29T08:15:53.879326+00:00, sha a89855921333)
  - site_page: https://huggingface.co/docs (fetched 2026-08-29T08:15:53.882044+00:00, sha bdec26667b98)
  - site_page: https://huggingface.co/docs/tokenizers/quicktour (fetched 2026-08-29T08:15:53.886329+00:00, sha 9ffd46723168)
  - site_page: https://huggingface.co/docs/tokenizers/installation (fetched 2026-08-29T08:15:53.888228+00:00, sha 120e11ad6eb6)
  - site_page: https://huggingface.co/docs/tokenizers/pipeline (fetched 2026-08-29T08:15:53.890159+00:00, sha 969882ba95f0)
  - site_page: https://huggingface.co/docs/tokenizers/components (fetched 2026-08-29T08:15:53.893153+00:00, sha 8a1b71b2e1a0)
  - site_page: https://huggingface.co/docs/tokenizers/training_from_memory (fetched 2026-08-29T08:15:53.895162+00:00, sha c02abec9c9b6)
  - site_page: https://huggingface.co/docs/tokenizers/api/input-sequences (fetched 2026-08-29T08:15:53.897187+00:00, sha 21cbf2ad7e53)
  - registry_crates: https://crates.io/api/v1/crates/tokenizers (fetched 2026-08-29T08:15:53.898872+00:00, sha 6d1245fb5b91)
- Data as of 2026-08-30T08:39:29.467469+00:00.
