Get digest length, hex and Base64 output size, block size and collision resistance for any SHA-1, SHA-2 or SHA-3 variant.
SHA-2 uses Merkle–Damgård padding: a 0x80 marker plus a 64-bit (SHA-224/256) or 128-bit (SHA-384/512) length field, padded to a whole block. SHA-3 is a sponge, so its absorbing rate shrinks as the digest grows, and collision resistance in both families is half the digest length because of the birthday bound. Column widths, HSM buffers and token size limits all depend on the exact hex or Base64 length, and picking a digest with under 128-bit collision resistance breaks any signature or dedup scheme built on it.
SHA Hash Length
digest bytes = digest bits ÷ 8; hex chars = 2 × bytes; collision resistance = digest bits ÷ 2 (birthday bound); blocks = ⌈(message + padding) ÷ block size⌉.
Keccak rate
SHA-3 rate = 200 − 2 × (digest bytes), giving 136 bytes for SHA3-256 and 72 bytes for SHA3-512.
digest bytes = digest bits ÷ 8; hex chars = 2 × bytes; collision resistance = digest bits ÷ 2 (birthday bound); blocks = ⌈(message + padding) ÷ block size⌉. SHA-2 uses Merkle–Damgård padding: a 0x80 marker plus a 64-bit (SHA-224/256) or 128-bit (SHA-384/512) length field, padded to a whole block. SHA-3 is a sponge, so its absorbing rate shrinks as the digest grows, and collision resistance in both families is half the digest length because of the birthday bound.
Column widths, HSM buffers and token size limits all depend on the exact hex or Base64 length, and picking a digest with under 128-bit collision resistance breaks any signature or dedup scheme built on it.
This calculator takes 2 inputs: Hash algorithm, Message length. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
SHA-512 works on 64-bit words and absorbs 128 bytes per block instead of 64, so on a 64-bit CPU without SHA-NI extensions it processes roughly 1.5× more bytes per second despite the larger digest.