Start a project

Tool 321 of 450 · Identifiers

ID Collision Probability Calculator

Work out the chance of a collision for random IDs (UUID v4, nanoid, short codes) from alphabet, length and how many you generate.

ID Collision Probability Calculator

Your input

Result

MeasureValue

    01

    What it does

    Work out the chance of a collision for random IDs (UUID v4, nanoid, short codes) from alphabet, length and how many you generate.

    • UUID v4, UUID v7, ULID, nanoid and custom alphabets
    • Birthday-bound maths in log space (no overflow at 2^128)
    • Probability as a percentage and as 1 in N
    • IDs you can make before a 1% or 50% chance

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Collision odds, safe counts and time to 1%, with a Copy and a Download button on every result.

    • UUID
    • nanoid
    • Probability

    Why it matters

    Short IDs are friendlier in URLs, but the birthday problem bites early: an 8-character code from 62 symbols is more likely than not to collide by about 17 million IDs.

    This shows how long your IDs need to be for the volume you expect, so you pick a length on purpose rather than by guesswork.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Calculate. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Will two UUID v4s ever collide?

    In practice, no: you'd need about 2.7 quintillion of them for a 50% chance. Bugs in random number generators are a far bigger risk than the maths.

    Why is UUID v7 different?

    Its first 48 bits are a timestamp, so only IDs made in the same millisecond can collide, and those share 74 random bits. The tool works out the chance per millisecond and over a year at your rate.

    What's the birthday problem?

    With n random picks from N possibilities, the chance of a repeat is about 1 − e^(−n²/2N), so collisions become likely around √N picks, much sooner than N.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk