An embedding is a way of converting a piece of data — a word, a sentence, an image, even a whole document — into a list of numbers called a vector, arranged so that things with similar meaning end up with similar numbers. That single trick is what lets a computer, which only understands numbers, work with something as fuzzy as meaning: it can tell that “puppy” and “dog” belong together and that both are far from “stock market,” without ever being told a single rule about language.
What an embedding actually is
Think of an embedding as a coordinate, the way latitude and longitude pin a place on a map — except instead of two numbers, an embedding usually has hundreds or thousands of them, and instead of physical location, the “map” represents meaning. This idea is called a word embedding when applied to language, though the same technique now works on images, audio, and even computer code. Two sentences that mean roughly the same thing — “cancel my order” and “I want a refund” — land close together in this space, even though they don’t share a single word. A model can then measure “closeness” mathematically (usually with a calculation called cosine similarity) instead of matching exact words.
This is different from a token, which is just a chunk of text a model reads — a word or piece of a word. An embedding is what the model produces from those tokens: a compressed numeric summary of what the text means.
How embedding models are built
Embeddings come from neural networks trained on enormous amounts of text (or images, or both). During training, the network repeatedly guesses what word or concept should appear next to another, and adjusts its internal numbers until words that truly appear in similar contexts end up with similar vectors. Modern embedding models are typically built on the same large language model architecture used for chatbots, just trained to output one fixed-length vector per input rather than generate new text. OpenAI’s current models, for instance, produce vectors of 1,536 or 3,072 numbers depending on size, and Google’s Gemini embedding model can map text, images, audio, and video into that same shared numeric space, so a text query can retrieve a matching photo.
Why embeddings matter
Embeddings are the hidden layer underneath most things that feel like AI “understanding.” Semantic search uses them to return results that match a query’s meaning rather than its exact wording. Recommendation systems use them to find products or songs that are conceptually similar to ones a user already liked. And they are the backbone of retrieval-augmented generation, the technique that lets a chatbot look up facts from a company’s own documents before answering — the documents are converted into embeddings, stored in a vector database, and the ones closest to a user’s question are pulled back and handed to the model as context. Without embeddings, that lookup step would have to rely on matching exact keywords, which fails as soon as a user phrases something differently than the source text does.
How to start using embeddings
Using embeddings doesn’t require training anything. Developers typically call an existing embedding model through an API — OpenAI publishes an embeddings guide that shows how to send text to an endpoint and get a vector back — store the resulting vectors in a vector database, and compare new queries against them. Google’s Gemini API and several open-source models offer the same basic workflow for teams that want to keep the computation on their own infrastructure.
The cost is usually the least of a project’s worries: as of July 2026, OpenAI charges $0.02 per million tokens for its smaller text-embedding-3-small model and $0.13 per million tokens for the larger, more accurate text-embedding-3-large, per OpenAI’s own model pricing — cheap enough that embedding an entire small book costs a fraction of a cent. Larger, higher-dimension models cost more and generally return more accurate matches, so the trade-off is accuracy versus cost and storage size, not cost versus complexity.
Embeddings rarely make headlines the way a new chatbot does, but they are one of the most load-bearing pieces of AI infrastructure in use today — the quiet mechanism that lets software search, sort, and retrieve by meaning instead of by exact words.