Skip to content
ENExplore Calculators

Random Number Entropy Calculator

Work out random number entropy instantly with clear inputs, formula shown and shareable results.

About Random Number Entropy Calculator

A byte only carries eight bits of entropy if the source is ideal; real sources produce less, so producing full-entropy output requires collecting proportionally more raw bytes and conditioning them through a hash or extractor. The source class matters more than the quantity: a non-cryptographic generator such as Math.random is predictable from a handful of outputs no matter how many bytes you draw.

Formula

Entropy accounting

total entropy = output bytes x entropy per byte; raw bytes needed = ceil(output bits / entropy per byte)

Worked example

With the default values below, Random Number Entropy Calculator returns Entropy in the output of 208.0. Change any input above and every figure here is recalculated in your browser.

Inputs used

Random output requiredminimum 1 bytes
32 bytes
Entropy per byte of the sourceaccepts 0.01–8 bits
6.5 bits
Entropy sourceone of Hardware RNG / RDRAND, OS CSPRNG (getrandom, CryptGenRandom), Language Math.random or rand()
OS CSPRNG (getrandom, CryptGenRandom)

Results

Entropy in the output
208.0 bits
Raw source bytes needed for full-entropy output
40 bytes
Shortfall against 256 bits
48.0 bits
Suitability assessment
Sufficient for 128-bit security

Step by step

  1. 1Values used
  2. 2Entropy accounting
  3. 3Entropy in the output= 208.0 bits
  4. 4Raw source bytes needed for full-entropy output= 40 bytes
  5. 5Shortfall against 256 bits= 48.0 bits
  6. 6Suitability assessment= Sufficient for 128-bit security

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Which API should I use?

The operating system CSPRNG — getrandom or /dev/urandom on Linux, BCryptGenRandom on Windows, SecRandomCopyBytes on Apple platforms — or your language's crypto-specific random function.

Does the entropy pool run dry?

Modern kernels seed a CSPRNG once and then generate indefinitely, so blocking on entropy is only a concern at very early boot on devices without a hardware RNG.

Random Number Entropy Calculator | Calcrivo