Free tool · no sign-up

Vector Index Memory Calculator

Most vector-database sizing assumes vectors × dimensions × 4 bytes. That misses the HNSW graph, payload, replicas and allocator headroom — the parts that actually fill RAM. This calculator includes them.

Index shape

RAG cost calculator

HNSW graph estimate: vectors × M × 2 × 4 bytes. Real implementations vary; use this as a planning baseline and verify with your database's own metrics.

Estimated memory

Enter your index shape.
Raw vectors—
HNSW graph—
Per replica—
Recommended RAM—

How the estimate works

ComponentFormulaWhy it matters
Raw vectorsvectors × dimensions × bytesThe floor. float32 = 4 bytes, float16 = 2, int8 = 1.
HNSW graphvectors × M × 2 × 4 bytesEach vector stores up to M neighbors per layer. The graph can add 20–60%.
Payloadvectors × payload bytesMetadata, filters, IDs and document text kept alongside the vector.
Replicasper-replica total × replicasEvery replica holds a full copy.
Headroomtotal × 1.5Allocator overhead, compaction, segment merges and query working set.

Worked example

One million vectors at 1,536 dimensions in float32 is about 6.1 GB of raw vectors. With M=32, the HNSW graph adds roughly 256 MB. A 256-byte payload adds another 256 MB, and two replicas double the total to about 13.2 GB. A 1.5× headroom multiplier puts the planning figure near 19.8 GB. That is the number to compare with your vector database's memory limit, not the 6.1 GB raw figure.

What to check before you buy RAM

Sizing the rest of the RAG stack?

Estimate ingestion, embeddings and generation cost with the RAG cost calculator, then compare embedding models.

RAG cost calculator Embedding comparison

FAQ

How much RAM does a vector index need?

Start with vectors × dimensions × bytes per dimension, add the HNSW graph, payload and replicas, then multiply by 1.5 for headroom.

Does HNSW use more memory than flat search?

Yes. HNSW adds a graph with up to M neighbors per layer per vector, plus bookkeeping. The graph can add 20–60% on top of raw vector memory.

Should I use float32, float16 or int8?

float32 is 4 bytes per dimension, float16 is 2 and int8 is 1. Quantization reduces memory but can lower recall; measure before switching.

How do replicas affect memory?

Each replica holds a full copy of the index, so memory scales linearly with the replica count.

This calculator is a planning tool, not a benchmark. Actual memory depends on the vector database, index type, segment count and allocator.