---
title: "Tokenization (NLP)"
slug: tokenization
date: 2026-06-09T09:58:44+00:00
modified: 2026-06-09T09:58:44+00:00
permalink: https://brightdata.com/glossary/tokenization
type: page
---

# Tokenization (NLP)

**TLDR:** Tokenization splits text into smaller units called tokens. It is the first step in nearly every NLP pipeline.

**Tokenization** is the process of breaking text into tokens. A token can be a word, a subword, or a single character. Models cannot read raw text directly. They read sequences of numeric token IDs. Tokenization converts text into those IDs. It is the first step in [natural language processing](/glossary/natural-language-processing).

## Types of Tokenization

1. **Word Tokenization**: Split text on spaces and punctuation.
2. **Subword Tokenization**: Split rare words into smaller known pieces.
3. **Character Tokenization**: Treat every character as one token.
4. **Sentence Tokenization**: Split a document into individual sentences.

## How Subword Tokenization Works

Modern [large language models](/glossary/large-language-model) use subword tokenization. Common words stay whole. Rare words split into smaller known pieces. This keeps the vocabulary small. It also handles unseen words gracefully. Byte-Pair Encoding (BPE) is the most common method.

## Why Tokenization Matters

1. **Vocabulary Size**: It controls model size and processing speed.
2. **Context Windows**: Limits are measured in tokens, not words.
3. **Cost**: LLM API pricing is charged per token.
4. **Language Coverage**: Poor tokenization hurts non-English text quality.

## Tokenization and Embeddings

After tokenization, each token maps to an embedding. An embedding is a numeric vector the model can process. See [embeddings in machine learning](/blog/ai/embeddings-in-machine-learning). Token embeddings feed into the model’s [attention layers](/glossary/attention-mechanism). This pipeline turns raw text into model-ready numbers.

## Building Tokenizers with the Right Data

Tokenizers are trained on large, diverse text corpora. The data shapes which subwords the tokenizer learns. Broad [training data](/glossary/training-data) improves coverage across languages. Bright Data’s [Web Scraper](/products/web-scraper) collects real-world multilingual text. Its [datasets](/products/datasets) provide clean corpora for tokenizer and model training.

Start free trial[Start with Google](#)





 ## Trusted by 50,000+ customers worldwide



























































Welcome to the Scraping Cloud

## Maximum Control and Efficiency

 [Proxies

Premium proxy infrastructure. 100% ethically sourced IPs.

- Automated session management
- Target any city in 195 countries
- Unlimited concurrent sessions





 Proxy Services





 ](/proxy-types)

 [Unlocker

Say goodbye to blocks and CAPTCHAs with a single API.



 Unlocker





 ](/products/web-unlocker)

 [Browser

Scale dynamic scraping with built-in unblocking and proxies



 Scraping Browser





 ](/products/scraping-browser)

 [Functions

Run your scrapers as fully-hosted serverless functions.



 Functions





 ](/products/web-scraper/functions)

 [Scrapers

Extract parsed data on-demand with dedicated scraper APIs.



 Scrapers API





 ](/products/web-scraper)

 [Datasets

Get fresh, validated datasets from any public website.



 Datasets





 ](/products/datasets)

 [SERP API

Quick and easy search engine scraping on demand



 SERP API





 ](/products/serp-api)







### Ready to get started?

Start free trial
