Skip to content

Vector Storage Calculator

Estimate how much disk or RAM a vector database needs: embeddings by dimension and precision, metadata, HNSW index overhead and replicas.

Calculator Details

Storage needed:3.412 GBSee results ↓

Embeddings to store: one per document chunk, image or product.

Length of each embedding; 384, 768, 1,024, 1,536 and 3,072 are common (see your model card).

float32 = 4 bytes per number; float16 and bfloat16 = 2; int8 (scalar quantised) = 1; binary = 1 bit.

ID, source link, filters and any stored text. 0 if the vectors are stored alone.

HNSW (the usual approximate-nearest-neighbour graph) adds neighbour links per vector; flat (brute force) stores only the vectors.

Decimal GB (1,000³ bytes) as cloud storage bills it, or binary GiB (1,024³ bytes) as RAM is sized.

Your Results

Storage needed: 3.412 GB

Storage needed

3.412 GB

3,412,000,000 bytes

Per vector

3,412 bytes

3,072 vector + 200 metadata + 140 index

Vectors alone

3,072,000,000 bytes

Index

140,000,000 bytes

HNSW neighbour links (hnswlib layout)

Storing these float32 embeddings takes about 3.412 GB: 3,412 bytes per vector, of which 3,072 are the vector itself.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Total size by precision

Total size by precision

Detailed Breakdown

The same collection at each precision
PrecisionBytes per vectorTotal
float32 (you)3,4123.412 GB
float161,8761.876 GB
int81,1081.108 GB
binary436436 MB

Bytes per vector include metadata and the index. bfloat16 is the same size as float16.

How This Calculator Works

How the storage is calculated

bytes per vector = ⌈dimensions × bits ÷ 8⌉ + metadata + index

HNSW index (hnswlib) = 2 × M × 4 + 4 + 8 bytes per vector

total = vectors × bytes per vector × copies

3,072 + 200 + 140 = 3,412 bytes

1,000,000 × 3,412 × 1 = 3,412,000,000 bytes = 3.412 GB

HNSW keeps up to 2·M neighbour IDs for every vector on its bottom layer (4 bytes each), a count and an 8-byte label, as in hnswlib's memory layout. Upper layers hold about one vector in M and add a few percent more.

Frequently Asked Questions

How much storage do 1 million embeddings need?

Multiply the dimensions by 4 bytes for float32: one million 768-dimension vectors are 3.07 GB, and 1,536 dimensions double that to 6.14 GB. Add your metadata and the index on top; with 200 bytes of metadata and an HNSW index at M = 16, the 768-dimension collection comes to about 3.41 GB.

How much memory does an HNSW index use?

In hnswlib, each vector keeps up to 2 × M neighbour IDs of 4 bytes on the bottom layer, plus a 4-byte count and an 8-byte label: 8 × M + 12 bytes. At the default M = 16 that is 140 bytes per vector, small next to a 3,072-byte float32 vector but significant for compressed ones. Upper layers add a few percent more.

Does quantisation reduce vector storage?

Yes: float16 halves it, int8 (scalar quantisation) quarters it, and binary quantisation keeps one bit per dimension, 1/32 of float32. The trade-off is search quality, so many systems keep full-precision vectors on disk for re-ranking and search a compressed copy in memory.

Should the index be in RAM or on disk?

HNSW is fast when the graph and vectors fit in RAM, which is why its size matters for picking a server. Disk-based indexes (such as DiskANN-style or IVF on SSD) keep most data on disk and need far less RAM, at some cost in latency.

Why do I need the number of dimensions?

Each dimension is one stored number, so storage grows in direct proportion: 3,072 dimensions take four times the space of 768. The dimension is fixed by the embedding model (see its model card), and some models let you shorten it.

What should I count as metadata?

Everything stored with each vector: its ID, the source document reference, filter fields such as date or tenant, and any text chunk kept for display. Storing the original text can easily take more space than the vector itself.

Why GB here but GiB in my database dashboard?

Cloud storage is billed in decimal GB (1,000,000,000 bytes), while memory and many database tools report binary GiB (1,073,741,824 bytes), about 7% larger. Switch the size units to match the figure you are comparing with.

Vectors × dimensions × bytes per number, plus the metadata you enter and an HNSW index sized from hnswlib's memory layout (bottom-layer links of 8 × M + 12 bytes per vector), times the number of copies. Sizes in decimal GB or binary GiB, as you choose. Not included: HNSW upper layers (a few percent of the index), IVF and product-quantisation indexes, database page, WAL and segment overhead, deleted rows awaiting compaction, and backups.

Vector Storage Calculator: How Much Space Do Embeddings Need?

By FindMySum · Last reviewed

A vector storage calculator estimates how much disk or memory a collection of embeddings needs. Each embedding is a list of numbers, one per dimension, so the raw size is easy to work out; what catches people out is everything stored around it: metadata, the search index and extra copies. This page adds those up and shows the total in decimal GB or binary GiB. The worked example uses the defaults: one million 768-dimension float32 vectors with 200 bytes of metadata each and an HNSW index at M = 16.

The formula

bytes per vector = dimensions × bytes per number + metadata + index

total = vectors × bytes per vector × copies

PrecisionBytes per numberTypical use
float324What most embedding models output
float16 / bfloat162Half the space, little quality loss
int81Scalar quantisation
binary1/8 (one bit)Binary quantisation, often with re-ranking

A binary vector is rounded up to whole bytes: 1,024 dimensions take 128 bytes.

Worked example

  1. Vector: 768 × 4 = 3,072 bytes.
  2. Metadata: 200 bytes (an ID, a source reference and a few filter fields).
  3. HNSW index: 2 × 16 × 4 + 4 + 8 = 140 bytes.
  4. Per vector: 3,072 + 200 + 140 = 3,412 bytes.
  5. Total: 1,000,000 × 3,412 = 3,412,000,000 bytes = 3.412 GB, or 3.18 GiB.

The vectors are 90% of it. Switch to int8 and each vector drops to 768 bytes, taking the total to about 1.11 GB; with binary quantisation the vector shrinks to 96 bytes, and metadata and the index become most of the size.

Where the HNSW figure comes from

HNSW (hierarchical navigable small world) is the graph index most vector databases use for fast approximate search. Each vector is linked to its nearest neighbours on several layers. In hnswlib, the reference implementation, every element reserves room on the bottom layer for up to 2 × M neighbour IDs of 4 bytes each, plus a 4-byte count and an 8-byte label: 8 × M + 12 bytes. The library's own notes put HNSW memory at roughly M × 8–10 bytes per element. Upper layers hold about one element in M, so they add a few percent more; the calculator leaves them out and says so. Other databases lay out their graphs differently, but the order of magnitude is the same.

A flat index stores nothing extra and compares the query with every vector, which is fine for a few hundred thousand vectors and slow beyond that.

Metadata is easy to underestimate

The vector is fixed by the model, but metadata is up to you. An ID and a URL are small; the original text chunk kept for display can be 2,000 bytes or more, which is bigger than a 384-dimension float32 vector. If your database stores the text alongside the vector, count it here.

GB, GiB and what you are sizing

Cloud object storage and disks are sold in decimal GB. RAM is built in binary units and many database dashboards report GiB, about 7% larger per unit. The calculator offers both as a labelled choice. For a server that keeps the HNSW graph in memory, size RAM from the GiB figure and leave headroom for queries and inserts.

Sizing a full system

Multiply by replicas for high availability, add backups, and remember that deletes often leave space behind until the database compacts its segments. If you also run the embedding model yourself, the VRAM calculator estimates its GPU memory, and the context window calculator shows how many retrieved chunks fit in each prompt.

More questions

How many vectors will my documents produce?

One per chunk. Divide each document's length in tokens by your chunk size (allowing for overlap) and add them up: 10,000 documents of 4,000 tokens in 500-token chunks with no overlap make 80,000 vectors. Images, products or users usually get one vector each.

Does reducing dimensions hurt search quality?

Somewhat, and how much depends on the model. Some embedding models are trained so their vectors can be shortened with little loss; others are not. Test recall on your own queries before and after, the same way you would test quantisation.

How much RAM does a vector database server need?

For an in-memory HNSW index, at least the vectors plus the index, with headroom for queries, inserts and the operating system: a common rule of thumb is to add 25–50% on top of this calculator's result. Disk-based indexes need much less RAM.

Do replicas double the storage bill?

Yes. Each replica is a full copy, so two replicas store twice the data and three store three times. Backups and snapshots are extra copies on top, usually on cheaper storage.

What is the M parameter in HNSW?

The number of links each vector gets to its nearest neighbours when it is added to the graph. Higher M improves recall on hard, high-dimensional data but costs memory (8 bytes per vector per unit of M in hnswlib's bottom layer) and build time. Values from 12 to 48 cover most uses.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy