Entropy Bits From Charset × Length

Calculate ideal entropy for independent uniform draws from a supplied character-set size.

Description

Ideal entropy for independent uniform character choices is the logarithm of the number of possible strings.

Ideal entropy for independent uniform character choices is the logarithm of the number of possible strings. Length and alphabet size describe that model, whereas predictable selections can carry much less information.1

Calculate ideal entropy for independent uniform draws from a supplied character-set size.

When to use Entropy Bits From Charset × Length

Use this tool to calculate ideal entropy for independent uniform draws from a supplied character-set size.

Choose the text, counts, explicit reference time or format parameters requested by this tool. Follow the stated byte, epoch-time and randomness assumptions.

How to use Entropy Bits From Charset × Length and understand its results

  1. Choose the text, counts, explicit reference time or format parameters requested by this tool. Follow the stated byte, epoch-time and randomness assumptions.
  2. Enter alphabetSize, length using the field table and calculation rules, then run the tool.
  3. Read bits. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
alphabetSizeCharacter-set sizeinteger; minimum: 1; maximum: 9007199254740991Required
lengthIndependent character countinteger; minimum: 0; maximum: 9007199254740991Required

Enter a positive safe-integer number of distinct alphabet choices and a nonnegative safe-integer count of independent positions. The tool multiplies the position count by the base-two logarithm of the alphabet size and returns numeric bits. An alphabet of one or length zero gives zero; non-power-of-two sizes can produce fractional bits.

bits = length × log₂(alphabetSize)

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
bitsIdeal entropynumber; minimum: 0
json
{
  "input": {
    "alphabetSize": 64,
    "length": 10
  },
  "output": {
    "bits": 60
  }
}

Limitations and assumptions

It does not inspect a password, estimate a generator's bias or enforce composition rules. Repeated/correlated choices violate the independence assumption. The result uses floating-point logarithms; keyspace counting is available separately when an exact integer count is required.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use Keyspace Size Calculator: Return the exact keyspace size for independent positions chosen from a fixed-size alphabet, with bounded output materialization. For a complementary task, use Random Hex Token Bits From Characters: Return the ideal uniform-random capacity of a hexadecimal token from its number of independently random characters.

References

  1. Entropy Bits From Charset × Length — tool.io

Similar or alternative tools

  • Keyspace Size Calculator

    Return the exact keyspace size for independent positions chosen from a fixed-size alphabet, with bounded output materialization.

  • Random Hex Token Bits From Characters

    Return the ideal uniform-random capacity of a hexadecimal token from its number of independently random characters.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies