API Key Generator

Prefixed keys at fixed lengths, each with its entropy in bits.

Prefixes and entropy

A good API key is a long random string, often with a short prefix that signals where it belongs, for example sk_live_ or pk_test_. The prefix is not secret and adds no entropy; it just helps humans and tooling recognise and route the key. All of the security comes from the random portion.

The table below shows the entropy for each length using the default Base62 alphabet (62 characters). Even the shortest option here carries far more randomness than a typical password.

LengthEntropyRating
16 chars95 bitsStrong
24 chars143 bitsExcellent
32 chars191 bitsExcellent
48 chars286 bitsExcellent
64 chars381 bitsExcellent