Will YouTube Ever Run Out Of Video IDs?

Channel:Tom Scott · Length:5:10 · Published:2016-03-21 · Views:10068598

Watch on YouTube

Summary

Tom Scott explains YouTube's 11-character video IDs, which are base-64 encoded 64-bit numbers, and whether YouTube could ever run out of them. It covers counting systems and base 64 briefly.

Why HN recommends it

HN links it whenever IDs, base64 or random identifier space come up, as a short and pleasant explainer.

There's a Tom Scott video [2] that describes Youtube video IDs as 11-digit base-64 random numbers — HN, 2026

Software (other) · Internet culture & memes

Subtitles (excerpt)

Every YouTube video has a unique ID. It's up in the URL: a string of eleven characters that uniquely identifies which video you want. Now, YouTube has millions and millions of videos. The last stats that they released said they have 400 hours of video being uploaded every minute. So: are they ever going to run out of those IDs? Well, to find out, let's talk about counting systems. People count in Base 10. 0 to 9. That'll be, hopefully, familiar to you. Computers count in base 2, in binary, but that's difficult for humans to read, it gets too long to write really, really quickly, so often computers will display it in base 16, hexadecimal. You have 0 to 9, and then A to F, and then you start adding to the next column. Humans can't understand that easily, but it's efficient if we have to type it in somewhere, and 16 - 2 to the power of 4 - is also easy for computers to deal with. So how about Base 64? That'd be a ridiculous counting system, right? Except. 64 is another one of those easy numbers for computers, it is 2 to the power of 6. And humans can get to 64 very easily: 0 to 9, then capital letters A to Z, then small letters a to z, and two other characters. Most Base 64 uses slash and plus, but they don't work so well in URLs,

On Hacker News

Him dancing around and celebrating at the end of his 5 minute explanation of YouTube IDs [1] is such an uplifting thing to watch. 1: [VIDEO] — apocalyptic0n3, 2021-02
I forget the context but the other day I also learned about Snowflake IDs [1] that are apparently used by Twitter, Discord, Instagram, and Mastodon. Timestamp + random seems like it could be a good tradeoff to reduce the ID sizes and still get reasonable characteristics, I'm surprised the article didn't explore there (but then again "timestamps" are a lot more nebulous at universal scale I suppos… — ekipan, 2026-02
Similar to the old situation in the article, we are using sequential 64 bit primary keys, but we use an additional random 64 bit key for external usage (instead of 128 bit). The external key is base64 encoded for use in URLs which results in an 11 byte string. This hides any information about the size of the data, the creation date of customer accounts (which would be sort of visible with UUIDv7)… — dajonker, 2023-10
Well, have fun guessing 2^64 possibilities. YouTube lists even private videos "secured" using 11 BASE64 characters (66 bits in theory, but they seem to use just 64 bits). You can watch Tom Scott explain it: [VIDEO] CG-NAT doesn't really prevent geolocation. Better services will still pin-point you to the nearest city. There are perhaps easier ways to get your private info or your money - phishing… — kaliszad, 2021-08
Obligatory: [VIDEO] There’s too many IDs to iterate through. Searching for $defatltvideoname for some camera is far more effective for that. Scarily so. — tabletthrowaway, 2021-06

Related videos