Character-level tokenization and tokenizers

How character-level tokenization works, what counts as a character, how it compares with word and subword tokenizers, and when it suits your text workflow.

Character-level tokenization splits text into individual characters instead of words or subword pieces. It is simple to describe, but the word "character" hides real decisions that affect whether the output preserves meaning and stays usable. This review explains what a character-level tokenizer actually changes, how it compares with other approaches, and when plain text or a different tokenizer is the better choice.

Is character-level tokenization suitable for your use?

The main benefit is coverage. Because every input reduces to a small, fixed set of units, a character-level tokenizer never meets an unknown word. Misspellings, rare names, new slang, product codes and heavily inflected words are all represented without falling back to a catch-all unknown token. The decisive tradeoff is length. The same sentence produces far more tokens than it would under word or subword tokenization, so downstream models must process longer sequences and learn word-level meaning from scratch. In standard self-attention models, compute grows faster than sequence length, so this cost is not trivial.

  • Character-level tokenization tends to fit when:
  • Input is noisy, misspelled or user-generated.
  • The task depends on spelling or form, such as transliteration, spelling correction, string reversal or character-pattern detection.
  • You work with many languages or scripts and want to avoid a language-specific vocabulary.
  • Vocabulary size or out-of-vocabulary handling is a hard constraint.
  • It tends to fit poorly when:
  • The task depends on word or phrase meaning and inputs are long.
  • Compute or context length is tightly limited.
  • A well-tested subword tokenizer already exists for your language and model.

Plain, untokenized text remains preferable whenever a human reads, edits, searches or shares the content. Tokenization is a processing step for software, not a presentation format, and the original string should be kept alongside any token sequence.

What a character-level tokenizer actually changes

Tokenization does not alter the stored text. It produces a separate sequence of units, usually mapped to integer IDs from a vocabulary. Nothing is reversed, mirrored or restyled. The only question is where the boundaries fall, and that depends on what the tokenizer treats as one character.

  • Three common definitions of a character:
  • Bytes: the raw UTF-8 bytes. The vocabulary is at most 256 values, but one visible letter may take one to four bytes. Byte-level models such as ByT5 work this way.
  • Code points: individual Unicode scalar values. This is what most programming languages return when you iterate over a string. CANINE is an example of a model that operates on code points.
  • Grapheme clusters: what a reader perceives as a single character, defined by the Unicode Text Segmentation standard. An accented letter written with a combining mark, or an emoji built from several code points, counts as one cluster.

The choice matters most for accented text, many non-Latin scripts and emoji. The example below shows expected results in Python for one word written with a combining accent and one multi-part emoji. It uses the standard unicodedata module and the third-party regex module, which supports grapheme matching. Verify the output in your own environment.

import unicodedata
import regex  # third-party; supports \X for grapheme clusters

word = "cafe\u0301"  # "café" with a combining acute accent
print(len(word))                                   # 5 code points
print(len(unicodedata.normalize("NFC", word)))     # 4 after composing é
print(len(regex.findall(r"\X", word)))             # 4 grapheme clusters
print(word[::-1])  # accent now leads the string, attached to nothing

family = "\U0001F468\u200D\U0001F469\u200D\U0001F467"  # family emoji
print(len(family))                                 # 5 code points
print(len(family.encode("utf-8")))                 # 18 bytes
print(len(regex.findall(r"\X", family)))           # 1 grapheme cluster

Two lessons follow. First, normalization changes token counts: the same visible word yields four or five code-point tokens depending on whether it is stored composed (NFC) or decomposed (NFD), so a tokenizer should normalize consistently. Second, any operation that treats code points as characters can break text. Reversing by code point detaches the accent from its letter and splits the emoji into separate people joined by invisible characters. If your workflow reverses, truncates or samples character tokens, segment by grapheme cluster first.

Right-to-left scripts add one more clarification. Arabic and Hebrew text is stored in logical order, the order it is read, and the bidirectional algorithm reverses it only for display. A character-level tokenizer sees the logical order. Tokens that look reversed when printed in a left-to-right terminal are usually a display effect, not a tokenization error.

How it differs from word and subword tokenization

Approach | Unit | Vocabulary | Unknown words | Sequence length
Word-level | Whole words, split on spaces and punctuation | Large and open-ended | Common; mapped to an unknown token | Shortest
Subword (e.g. BPE, WordPiece, Unigram) | Frequent word pieces learned from data | Fixed, typically tens of thousands | Rare; broken into smaller pieces | Moderate
Character-level | Bytes, code points or grapheme clusters | Small and fixed | None, within the chosen unit set | Longest

Word-level tokenizers also struggle with languages that do not separate words with spaces, such as Chinese, Japanese and Thai, where character-level or subword methods avoid the need for a separate word segmenter. Subword tokenizers sit between the extremes and are the default for most current language models; many byte-level subword tokenizers fall back to individual bytes for anything outside their learned vocabulary.

Will the output stay readable and usable after copying or sharing?

Token sequences are not meant for people. A list of integer IDs is meaningless without the matching vocabulary, and a tokenizer and vocabulary must be shared together for anyone else to decode the output. A good character-level tokenizer should round-trip exactly: decoding the tokens returns the original string. Byte-level tokenizers can produce sequences that are not valid UTF-8 if cut mid-character, so truncation should happen on character or cluster boundaries.

Problems arise when tokenized text is displayed as if it were ordinary text, for example letters separated by spaces or delimiters. Such output no longer matches searches for the original words, is awkward to edit, and may be announced character by character by screen readers. That last point is a risk to test with the specific assistive technology your readers use; no documentation or test results were supplied here to confirm behavior for any named tool. When tokenized output must appear in a document, interface or message, provide the untokenized original as the plain-text equivalent.

Checklist for evaluating a character-level tokenizer

  • Which unit does it use: bytes, code points or grapheme clusters?
  • Does it apply Unicode normalization, and which form?
  • Does decoding reproduce the input exactly, including whitespace, combining marks and emoji?
  • How does it handle control characters, zero-width joiners and right-to-left marks?
  • Are truncation and padding done on safe boundaries?
  • Is the vocabulary documented and versioned so others can decode the output?
  • Is the original text retained for display, search and editing?

Gaps in this review

No benchmark results, model measurements or tool-specific documentation were supplied, so this review does not rank particular tokenizers or quantify accuracy, speed or memory differences between character-level and subword approaches. It also makes no claims about how any specific tool stores or retains the text you process. For those decisions, consult the documentation of the tokenizer or model you plan to use and run a scoped test on representative input, including accented text, emoji and any scripts your users write in.