Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Embedding Cost Calculator

Set your corpus (documents × average tokens), chunking (size + overlap), embedding model and vector dtype — and get the numbers that decide RAG budgets: one-time indexing cost, vector count, storage footprint from FP32 down to binary, and the monthly bill for query embeddings.

$1.84Index the corpus (one-time)92M tokens incl. overlap
179,688Vectors512-token chunks
1.03 GBVector storage1536d × 4 B (index adds ~1.5–2×)
$0.150/moQuery embeddings10K/day × ~25 tok
The quiet lever: vectors are usually re-read far more than re-written — quantizing storage to INT8 keeps ~99% of retrieval quality at ¼ the memory, and binary embeddings cut it 32× for shortlist-then-rescore pipelines. Storage dtype is a retrieval-eval decision, not a default.

Embedding a corpus is usually cheap; storing and serving the vectors is where the money and memory go. This calculator prices the one-time job of embedding your documents, counts the vectors that produces, sizes their raw storage at the precision you choose, and prices the query embeddings you will create every month.

What it computes

tokens   = documents × avg tokens per doc × (1 + overlap% / 100)
vectors  = ceil(tokens ÷ chunk size)
index $  = tokens / 1,000,000 × model price per 1M tokens
storage  = vectors × dimensions × bytes per value ÷ 2^30
query $  = queries per day × 30 × 25 tokens / 1,000,000 × model price
  • Model: three built-in options. Small is $0.02 per 1M tokens with 1,536 dimensions (for example text-embedding-3-small), large is $0.13 with 3,072 (for example text-embedding-3-large), and a self-hosted open model is $0.005 with 768.
  • Overlap: the share of extra tokens embedded because neighboring chunks repeat each other's edges.
  • Vector dtype: 4 bytes per value for FP32, 2 for FP16, 1 for INT8 and one bit (0.125 bytes) for binary.
  • Queries: each one is assumed to be 25 tokens, embedded with the same model.

Storage counts raw vectors only and is reported in binary gigabytes of 2^30 bytes.

A worked example

The defaults are the small model, FP32 vectors, 100K documents of 800 tokens, 512-token chunks with 15% overlap, and 10K queries a day.

  1. Tokens: 100,000 × 800 × 1.15 = 92,000,000, shown as 92M tokens incl. overlap.
  2. Vectors: 92,000,000 ÷ 512 = 179,687.5, rounded up to 179,688.
  3. Index cost: 92 × $0.02 = $1.84, paid once.
  4. Storage: 179,688 × 1,536 × 4 = 1,104,003,072 bytes, shown as 1.03 GB (1.10 GB in decimal units).
  5. Queries: 10,000 × 30 × 25 = 7,500,000 tokens a month, and 7.5 × $0.02 = $0.150/mo.

The same 179,688 vectors at each precision:

DtypeBytes per vectorStorage
FP326,1441.03 GB
FP163,0720.51 GB
INT81,5360.26 GB
Binary1920.03 GB

The large model raises the index bill 6.5 times, to $11.96, and doubles storage to 2.06 GB because every vector has twice the dimensions. Neither API bill is large here. The ongoing cost is the memory and the vector database that hold the result.

Assumptions and limits

  • Overlap as a flat surcharge. Tokens are inflated by the overlap percentage. A sliding window whose step is (1 − overlap) × chunk size re-embeds closer to 1 ÷ (1 − overlap): 1.18× at 15% rather than 1.15×, and 2× rather than 1.5× at 50%.
  • One continuous corpus. Vectors are counted as if every document were concatenated. Chunking each document separately rounds each one up: 800-token documents in 512-token chunks make 2 chunks apiece, 200,000 vectors rather than 179,688.
  • Raw vectors only. Index structures such as HNSW graphs, metadata, stored chunk text, replicas and backups all add to the storage figure.
  • Built-in prices. The three model prices are fixed in the tool and may differ from current list prices. A self-hosted model really costs hardware time, not a per-token fee.
  • Fixed query length and a 30-day month. Re-embedding after a model change or document edits is not included.

How to use the result

  • Budget for re-embedding, not just embedding. Changing models means paying the index cost again for the whole corpus, since vectors from two different models cannot share one index.
  • Size memory from storage, then add the index. Approximate nearest neighbor indexes usually keep vectors in RAM, so the storage figure plus index overhead is a floor for the machine or the managed tier.
  • Choose precision with an evaluation, not a default. Measure recall on your own queries at each dtype, and consider a binary or INT8 shortlist rescored with full-precision vectors.
  • Chunk size trades vectors for granularity. Halving chunks to 256 tokens doubles the vector count and storage at the same index cost, because the tokens embedded do not change.

When to use it, and when not

Use it at the start of a retrieval project, to see which of the three costs matters for your corpus and which inputs move it. For most corpora the answer is the same: the embedding bill is small, and the memory is what you size for. It is also the quick way to price a model switch, since every switch re-embeds everything.

It is not a vector database bill. Hosting is priced by memory, nodes or reads, and this tool stops at raw bytes. Nor does it price a self-hosted model, whose cost is GPU time divided by your measured throughput. And for a corpus that changes daily, model the update stream instead: only the changed chunks are embedded again.

Trade-offs and limits

Each input moves a different output, which is why tuning one rarely helps another:

InputEmbedding $VectorsStorageQuery $
Documents, tokens per docYesYesYesNo
OverlapYesYesYesNo
Chunk sizeNoInverseInverseNo
ModelPriceNoDimensionsPrice
Vector dtypeNoNoYesNo
Queries per dayNoNoNoYes

Scale shows the imbalance. At 10M documents instead of 100K, the small model costs $184 to embed and the large one $1,196. Storage grows to 102.8 GB and 205.6 GB of FP32 vectors before any index, which takes a large-memory machine or sharding. The API bill grew a hundredfold and stayed modest; the memory became the project.

The stored chunk text is also left out. At roughly 4 characters per English token, 92M tokens is about 0.34 GB of text, a third of the FP32 vectors and more than the INT8 ones.

Common mistakes

  • Entering words as tokens. At roughly 0.75 words per token, an 800-word document is about 1,067 tokens. Entering word counts understates cost, vectors and storage by a quarter.
  • Embedding queries with a different model. Query and document vectors must come from the same model, or similarity scores are meaningless. A model upgrade is therefore a cutover: re-embed the corpus, then switch queries with it.
  • Re-embedding everything after an edit. Store a hash of each chunk’s text and embed only the chunks whose hash changed. Keep chunk boundaries stable, too: one inserted paragraph should not shift every chunk after it.
  • Quantizing the vectors and forgetting the text. Binary vectors for the default corpus are 0.03 GB, but the chunk text beside them is about 0.34 GB. Past INT8, shrinking vectors further barely moves the total.

Check yourself

1M documents of 2,000 tokens, 20% overlap, 512-token chunks, the large model: what does indexing cost, and how much FP32 storage?

Tokens: 10⁶ × 2,000 × 1.2 = 2.4B, so 2,400 × $0.13 = $312. Vectors: 2.4B / 512 = 4,687,500. Storage: 4,687,500 × 3,072 × 4 / 1,024³ = 53.6 GB, or 13.4 GB as INT8.

At the defaults, what changes if chunks grow from 512 to 1,024 tokens?

Vectors halve to 89,844 and storage halves to 0.51 GB. The embedding bill stays $1.84, because the same 92M tokens are embedded; they are just split into fewer pieces.

How many queries a day before a month of query embedding costs as much as embedding the default corpus once?

A month of one daily query is 30 × 25 = 750 tokens, so it takes 92,000,000 / 750 ≈ 122,700 queries a day. The price cancels: the answer is the same for all three models.

With binary vectors, what dominates the default corpus’s storage?

Vectors are 179,688 × 1,536 / 8 = 34.5M bytes, 0.03 GB. The text, at about 4 characters per token, is 92M × 4 = 368M bytes, 0.34 GB: about 11 times the vectors.

once 100K docs × 800 tokens 92M tokens +15% overlap 179,688 vectors ÷ 512 1.03 GB × 1,536 × 4 B $1.84 once + index, text every month 10K queries/day × 25 tok × 30 7.5M tokens $0.15/month
The defaults end to end. The $1.84 is paid once per corpus version and the $0.15 every month; the 1.03 GB of raw vectors, plus the index and text beside them, is what you host.

How it works

  • Index cost = corpus tokens (incl. overlap) ÷ 1M × model price.
  • Vectors = corpus tokens ÷ chunk size; storage = vectors × dims × dtype bytes.
  • Storage is raw vectors in binary GB; index structures, metadata and text are extra.
  • Query spend recurs: queries/day × 25 tokens × 30 days.

Frequently asked questions

How much does it cost to embed documents for RAG?

Multiply the tokens you embed by the model price per million tokens. The defaults embed 100,000 documents of 800 tokens with 15% chunk overlap, 92 million tokens, which costs $1.84 at $0.02 per million and $11.96 at $0.13 per million. Embedding is a one-time charge per corpus version, so for most projects the larger costs are the vector database that stores the result and the repeat bill whenever you re-embed after changing the model or the chunking.

How much storage do embeddings need?

Multiply the number of vectors by the dimensions and by the bytes per value. A 1,536-dimension FP32 vector is 1,536 times 4, or 6,144 bytes, so the default 179,688 vectors take 1,104,003,072 bytes, shown as 1.03 GB in binary units. That figure is raw vectors only. The index structure, metadata, stored chunk text and replicas add to it, and approximate nearest neighbor search usually wants the working set in memory.

How does chunk size change embedding cost?

Chunk size changes the number of vectors, not the number of tokens you pay to embed. Halving the default chunk from 512 to 256 tokens doubles the vectors from 179,688 to 359,375 and storage from 1.03 GB to 2.06 GB, while the one-time embedding cost stays $1.84. Overlap is what raises the embedding bill, because the overlapping tokens are embedded again, and it adds vectors as well.

Should I store embeddings as FP32, FP16, INT8 or binary?

Lower precision cuts memory in proportion: FP16 is half of FP32, INT8 a quarter and binary, at one bit per dimension, a thirty-second. For the default corpus that is 1.03, 0.51, 0.26 and 0.03 GB. How much retrieval quality each step costs depends on the model and the data, so measure recall on your own queries. A common pattern is a binary or INT8 shortlist that is then rescored with full-precision vectors.

How much do query embeddings cost?

Every search embeds the query with the same model, and the calculator assumes 25 tokens per query over a 30-day month. Ten thousand queries a day is 7.5 million tokens a month, $0.15 with the small model at $0.02 per million and about $0.98 with the large one. Even at the slider maximum of a million queries a day the small model costs $15 a month, so query embedding is rarely the expensive part of retrieval.

What does a self-hosted open embedding model cost?

The tool prices its open option at $0.005 per million tokens with 768 dimensions, a stand-in for the compute a self-hosted model uses rather than a vendor fee. Your real cost is hardware time divided by throughput, so measure how many tokens per second your machine embeds and divide its hourly price by that rate. The smaller dimension count also halves storage against a 1,536-dimension model, which matters more as the corpus grows.