Dev Encyclopedia
ArticlesTools

Get notified when new content drops

No spam. Just new articles, tools, and updates straight to your inbox.

Dev Encyclopedia

A reference for builders

Content

  • Articles
  • Tools
  • Contact

Connect

  • support@devencyclopedia.com
  • RSS Feed

© 2026 Dev Encyclopedia

Privacy PolicyTermsDisclaimer
  1. Home
  2. /
  3. Tools
  4. /
  5. RedisCalc
Free · Live

Redis memory calculator: estimate usage and instance size

Before you provision a Redis instance, know how much memory it actually needs. Enter your key count, data type, and value sizes to get an estimated memory footprint, a breakdown of overhead, and a recommended instance size, all calculated locally in your browser.

Not sure Redis is the right layer for your data in the first place? Read our caching strategies guide to see how Redis compares to CDN, browser, and in-process caching.

  1. 1

    Enter your key count

    from 1,000 to 100M, slider or type a number
  2. 2

    Pick a data type and size

    String, Hash, List, Set, or Sorted Set
  3. 3

    Read the estimate

    memory total, breakdown, and instance size

How RedisCalc works

  1. 1

    Set the number of keys you expect to store, from 1,000 up to 100 million, using the slider or typing a number directly.

  2. 2

    Choose the data type: String, Hash, List, Set, or Sorted Set. Each type has a different memory layout in Redis, so this changes the formula used.

  3. 3

    For Hash, Set, and Sorted Set, set the average number of fields or members per key. For String, this is fixed at one value per key.

  4. 4

    Set the average value size in bytes, either using the Small/Medium/Large presets or typing an exact number.

  5. 5

    Toggle TTL on if your keys expire, and set what percentage of keys carry a TTL. Expiring keys carry a small additional memory cost in Redis's expires dictionary.

  6. 6

    Read the results: total estimated memory, a breakdown of raw data vs structural overhead vs expiry metadata, any encoding warnings, a recommended instance size, and an estimated cloud cost comparison for that size.

What the output means

Estimated total memory

The full estimated used_memoryfor your dataset: every key, value, and Redis's own bookkeeping for each, plus a flat 2MB for the Redis process itself. This is the number you'd expect to see reported by redis-cli INFO memory once the dataset is fully loaded.

Raw / overhead / expiry breakdown

The total is split into three parts, shown as both byte values and percentages:

  • Raw data: the actual payload bytes, your key names plus value content, with no Redis bookkeeping.
  • Structural overhead: everything Redis adds to store that data: dictEntry structs, object headers, SDS headers, encoding-specific overhead, and jemalloc allocation rounding.
  • Expiry metadata: the extra cost of tracking TTLs for keys that expire.

Memory overhead percentage

Structural overhead expressed as a percentage of raw data. Small values (short strings, few fields) have a much higher overhead percentage than large values, because the fixed per-key cost (about 56 bytes) is a bigger fraction of a tiny value than a large one. This is why storing thousands of 10-byte values is often less memory-efficient than batching them into fewer, larger structures.

Recommended instance size

The estimated total memory with 20% headroom added, rounded up to the nearest common instance size (256MB, 512MB, 1GB, 2GB, and so on up to 256GB). Running Redis near 100% of available memory risks evictions or OOM kills under noeviction, so the 20% buffer is intentional, not just rounding.

Encoding warnings

Shown when a Hash, Set, or Sorted Set exceeds the listpack thresholds (more than 128 entries, or any value over 64 bytes). For example, a Hash with 300 fields averaging 100 bytes each crosses both thresholds and gets stored as a hashtable instead of a listpack, roughly doubling the per-field overhead. The warning includes the exact CONFIG values involved so you can check or tune them.

Redis encoding thresholds reference

Redis automatically switches the internal encoding of a data structure once it grows past certain limits. Below those limits, collections use a compact, contiguous memory layout. Above them, Redis switches to a structure optimized for fast lookups at the cost of more memory per entry. The thresholds are identical between Redis 6 and Redis 7, only the compact encoding's name changed.

Data typeCompact encoding (v6 / v7)ThresholdsLarge encoding
Hashziplist / listpack≤ 128 entries and ≤ 64 bytes per valuehashtable
Set (non-integer)ziplist / listpack≤ 128 entries and ≤ 64 bytes per memberhashtable
Set (all integers)intset≤ 512 entries (set-max-intset-entries)hashtable
Sorted Setziplist / listpack≤ 128 entries and ≤ 64 bytes per memberskiplist
Listlistpack nodes (quicklist)per-node limits, configurablequicklist (always)

The relevant config directives, with their default values:

# Hash
hash-max-listpack-entries 128
hash-max-listpack-value 64

# Set
set-max-listpack-entries 128
set-max-listpack-value 64
set-max-intset-entries 512

# Sorted Set
zset-max-listpack-entries 128
zset-max-listpack-value 64

# List (quicklist node sizing)
list-max-listpack-size 128

On Redis 6.x, the same directives use the prefix ziplist instead of listpack (for example, hash-max-ziplist-entries). The numeric thresholds and behavior are otherwise the same; listpack is simply a more efficient successor format introduced as the default in Redis 7.

When to use RedisCalc

ScenarioWhat to enter
Sizing a session storeHash data type, number of expected concurrent sessions as keys, fields per key matching your session shape, TTL enabled at 100%
Sizing a product or API response cacheString data type, your average serialized JSON size as the value size, TTL enabled matching your cache expiry
Sizing a rate limiterString or Hash, one key per rate-limited identity, small value sizes (a counter), short TTLs at 100%
Justifying instance cost to a managerYour real numbers, then use the recommended instance size and cloud cost table to show the estimated monthly spend
Planning a migration from another cacheEstimate your current dataset's shape to compare memory footprint and cost before choosing a Redis tier
Deciding between String and Hash for small objectsTry both data types with the same total field count to compare overhead percentages directly

Frequently Asked Questions

What is RedisCalc and what does it estimate?

RedisCalc is a browser-based calculator that estimates how much memory a Redis dataset will use. Enter your key count, data type (String, Hash, List, Set, or Sorted Set), average value size, and whether keys expire, and it estimates total memory, a breakdown of raw data versus structural overhead versus expiry metadata, and a recommended instance size with 20% headroom.

It also flags when a Hash, Set, or Sorted Set exceeds the listpack encoding thresholds and switches to a less memory-efficient encoding, and shows an estimated cloud cost comparison across AWS ElastiCache, Google Cloud Memorystore, and Upstash for the recommended size.

How does RedisCalc compare to AWS ElastiCache's sizing guidance?
RedisCalcAWS sizing guidance
Vendor neutralYes, works for any Redis-compatible deploymentAWS-specific recommendations
Encoding-awareFlags listpack/hashtable/skiplist threshold crossingsGenerally not addressed
Memory breakdownRaw data vs structural overhead vs expiry, with percentagesLimited
Cloud cost comparisonAWS, GCP, and Upstash side by sideAWS only
Setup requiredNone, runs in your browser instantlyRequires AWS account and console access

RedisCalc is meant for early-stage sizing: before you provision anything, while you're still deciding between a managed Redis provider and self-hosting. Once you have a real workload running, your provider's monitoring (and the actual INFO memory output) will be more accurate than any estimator.

Is my data sent to DevEncyclopedia's servers?

No. RedisCalc runs entirely as client-side arithmetic in your browser. There are no network requests, no uploads, and nothing is stored or transmitted. You can disconnect from the internet after the page loads and the calculator still works.

How do I estimate memory for a session store with 500,000 sessions?

Say you're storing 500,000 user sessions as Redis Hashes, each with about 8 fields (user ID, role, last seen, cart ID, and so on) averaging 40 bytes per field value, and every session has a TTL of 30 minutes (so 100% of keys have a TTL).

Set Number of keys to 500,000, Data type to Hash, Average value size to 40, Fields per key to 8, enable TTL at 100%, and pick your Redis version. With these inputs, each session falls well within the listpack thresholds (8 fields, 40 bytes each), so it stays in the compact encoding.

RedisCalc will show the total estimated memory, the percentage that's structural overhead versus actual session data, and a recommended instance size with 20% headroom already applied, ready to compare against AWS ElastiCache, Memorystore, or Upstash pricing tiers.

Why does my hash use more memory than I expected?

This almost always means your hash has crossed the listpack (or ziplist on Redis 6) encoding thresholds: more than 128 fields, or any field/value larger than 64 bytes. Below those thresholds, Redis packs the whole hash into one compact contiguous allocation. Above them, it switches to a hashtable, where every field gets its own dictionary entry with separate pointers and per-entry overhead.

For example, a hash with 200 fields averaging 30 bytes each exceeds the 128-entry threshold and gets stored as a hashtable, roughly doubling the per-field overhead compared to the listpack encoding.

bash
# Check your current thresholds
redis-cli CONFIG GET hash-max-listpack-entries
redis-cli CONFIG GET hash-max-listpack-value

# Defaults
hash-max-listpack-entries 128
hash-max-listpack-value 64

If you control the data model, splitting very large hashes into smaller ones (for example, sharding by a hash of the field name) can keep each shard under the listpack thresholds. If that's not practical, the hashtable overhead is usually still acceptable: RedisCalc's encoding warning is informational, not necessarily a problem to fix.

Related reading

Guide

Caching Strategies Explained: CDN, Redis, In-Memory and DB Cache

Where Redis fits among caching layers, and how to choose cache-aside, write-through, or write-back patterns.

Guide

Node.js Interview Questions and Answers

Covers caching, event loop, and performance topics that come up alongside Redis in backend interviews.

Data type
100%
Redis version

Encoding thresholds are the same in both versions. Redis 7 renamed the compact encoding fromziplist tolistpack.

Estimated total memory

63.04 MB

Memory breakdown

Raw data50.74 MB (80.5%)
Structural overhead10.01 MB (15.9%)
Expiry metadata2.29 MB (3.6%)

Overhead vs raw data

20%

Encoding used

raw

Recommended instance

256.00 MB

Estimated monthly cost at 256.00 MB

Approximate, illustrative estimates. Check provider pricing pages for current rates.

ProviderSizeEst. monthlyNotes
AWS ElastiCache256.00 MB~$12/mocache.r7g node family, on-demand pricing
Google Cloud Memorystore256.00 MB~$35/moStandard tier, basic HA
Upstash256.00 MB~$10/moFixed-size pricing tier, pay-as-you-go also available

redis-cli INFO memory (estimated)

# Memory
used_memory:66097152
used_memory_human:63.04 MB
used_memory_rss:72706867
used_memory_rss_human:69.34 MB
used_memory_peak:66097152
used_memory_peak_human:63.04 MB
used_memory_lua:0
mem_fragmentation_ratio:1.10
mem_allocator:jemalloc-5.3.0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
How we calculate this

Every key in Redis carries a fixed overhead of about 56 bytes: the dictionary entry that points to the key and value, a hashtable bucket pointer, the redisObject header, and the SDS (Simple Dynamic String) header for the key itself.

We assume an average key name length of 20 bytes (something like user:session:1234567). If your keys are much longer or shorter, the real total will shift slightly.

If a key has a TTL, Redis stores it in a separate expires dictionary, adding roughly 24 bytes per expiring key (a dict entry plus an 8-byte expiry timestamp).

The value itself is sized differently per data type. Strings under 44 bytes use Redis'sembstr encoding, which packs the object header and string into one allocation. Hashes, sets, and sorted sets use a compact listpack encoding when they have at most 128 entries and each value is at most 64 bytes. Beyond those thresholds, Redis switches to a hashtable or skiplist, which uses more memory per entry but stays fast for large collections. Lists always use a quicklist of listpack nodes.

Once we have a raw byte estimate per key, we round it up to the nearest jemalloc allocation size class. Redis's default allocator (jemalloc) doesn't allocate exact byte counts: it rounds requests up to fixed size classes (8, 16, 32, 64... bytes and beyond), which is why real memory usage is always a bit higher than the raw data size.

Finally, we multiply the per-key total by your key count, add a flat 2.00 MBfor Redis's own process overhead, and apply a 20% headroom multiplier when recommending an instance size, since you never want a Redis instance running at 100% of available memory.

All calculations run locally in your browser. Nothing is sent to DevEncyclopedia servers.