Work out birthday attack probability instantly with clear inputs, formula shown and shareable results.
The birthday paradox means collisions appear after roughly sqrt(N) values rather than N, where N is the output space size. A hash with b output bits therefore offers only b/2 bits of collision resistance: SHA-256 gives 128 bits, and a 64-bit hash collides with even odds after about 5 billion values, which is why truncated hashes are dangerous as unique identifiers.
Birthday bound
P(collision) ~ 1 - exp(-k^2 / (2N)); k for probability p = sqrt(2 N ln(1/(1-p))); N = 2^bits
Because an attacker searches for any pair that matches rather than a specific preimage, and the number of available pairs grows quadratically with the number of values hashed.
For collision resistance it offers 64 bits, which is reachable by a determined attacker. Use at least SHA-256 truncated to 160 bits or more where collisions have security consequences.