By · Updated

Embedding Cost Calculator

Token Count, Re-Embedding Cost and Vector Storage Size for Your Document Collection

No ratings yet
Result

—

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Embedding Cost Calculator works

This embedding cost calculator estimates what it costs to turn a document collection into vectors for search or retrieval. Enter the document count, average length, price per million tokens and dimensions to get the tokens, one-off cost, number of vectors and storage needed.

How the embedding cost calculator works

An embedding model turns each piece of text into a fixed-length list of numbers, a vector, so similar meanings sit close together. Providers charge per token sent, and you store one vector per chunk. Words are converted to tokens at 0.75 words per token. Each vector takes 4 bytes per dimension as float32, or 1 byte per dimension when quantised to int8.

The formula is cost = tokens × price ÷ 1,000,000, with tokens = documents × words ÷ 0.75. Storage = vectors × dimensions × bytes per value.

First example. 10,000 documents of 1,000 words at $0.02 per million tokens is 13,333,333 tokens, about $0.27. Chunked at 500 tokens that is 30,000 vectors of 1,536 dimensions: 184.32 MB as float32 or 46.08 MB as int8, and re-embedding 10 percent a month costs about $0.03.

Second example. 1,000,000 documents of 300 words at $0.13 per million is 400,000,000 tokens and $52.00. One 3,072-dimension vector each needs 12.29 GB as float32 or 3.07 GB as int8, with $5.20 a month to refresh 10 percent.

How many dimensions do you need? Most retrieval works well at 512 to 1,536; many models let you shorten vectors to cut storage.

Raw vector storage by dimension count and number of vectors, before index overhead

Dimensions Vectors float32 (4 bytes each) int8 (1 byte each)
256 1,000 1.02 MB 256.00 KB
256 10,000 10.24 MB 2.56 MB
256 100,000 102.40 MB 25.60 MB
256 1,000,000 1.02 GB 256.00 MB
384 1,000 1.54 MB 384.00 KB
384 10,000 15.36 MB 3.84 MB
384 100,000 153.60 MB 38.40 MB
384 1,000,000 1.54 GB 384.00 MB
512 1,000 2.05 MB 512.00 KB
512 10,000 20.48 MB 5.12 MB
512 100,000 204.80 MB 51.20 MB
512 1,000,000 2.05 GB 512.00 MB
768 1,000 3.07 MB 768.00 KB
768 10,000 30.72 MB 7.68 MB
768 100,000 307.20 MB 76.80 MB
768 1,000,000 3.07 GB 768.00 MB
1,024 1,000 4.10 MB 1.02 MB
1,024 10,000 40.96 MB 10.24 MB
1,024 100,000 409.60 MB 102.40 MB
1,024 1,000,000 4.10 GB 1.02 GB
1,536 1,000 6.14 MB 1.54 MB
1,536 10,000 61.44 MB 15.36 MB
1,536 100,000 614.40 MB 153.60 MB
1,536 1,000,000 6.14 GB 1.54 GB
3,072 1,000 12.29 MB 3.07 MB
3,072 10,000 122.88 MB 30.72 MB
3,072 100,000 1.23 GB 307.20 MB
3,072 1,000,000 12.29 GB 3.07 GB

Tips and pitfalls

Embedding is usually the cheap part; storage, indexing and the language model calls that use the results cost more over time. Vector indexes such as HNSW add memory overhead on top of the raw sizes shown here. Changing embedding model means re-embedding everything, because vectors from different models cannot be compared.

FAQ

How much does it cost to embed a million words?

About 1,333,333 tokens at 0.75 words per token, so at $0.02 per million tokens it is under 3 cents, and at $0.13 per million about 17 cents. Batch APIs often halve the price.

How much storage does a vector take?

Dimensions × 4 bytes as float32, so a 1,536-dimension vector is 6,144 bytes. Quantising to int8 cuts that to 1,536 bytes, and binary quantisation to 192 bytes, with some loss of search quality.

Should I embed whole documents or chunks?

Chunks, for search and retrieval. A whole long document squeezed into one vector blurs its topics together. Chunks of 200 to 800 tokens are typical; set the chunk size to 0 here for one vector per document.

Why re-embed 10 percent a month?

It is a placeholder for content that changes: edited pages, new documents and deletions. Adjust it in your head for your own update rate; a static archive needs no re-embedding at all until you change model.

Where do I find embedding prices?

Each provider lists the price per million tokens on its pricing page. Enter any price here; the calculator does not assume a provider, so it works for hosted APIs and for estimating self-hosted costs per token.

See also: all AI tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, SEO, Accessibility.

Related tools