Get the Video ID From a YouTube Link
A YouTube video ID is the 11 characters after watch?v=, youtu.be/, shorts/, embed/ or live/ in its link. One formula pulls it from any of them: in Google Sheets =REGEXEXTRACT(A2,"(?:v=|v%3D|youtu\.be/|shorts/|embed/|live/|/v/|/e/|/w/|watch/)([A-Za-z0-9_-]{11})"), which gave the right ID for all 22 link forms Vi.ki tested on Nov 20, 2026.
A YouTube video's ID is the 11 characters that follow watch?v=, youtu.be/, shorts/, embed/ or live/ in its link, and one formula pulls it out of any of them: in Google Sheets, with the link in A2, =REGEXEXTRACT(A2,"(?:v=|v%3D|youtu\.be/|shorts/|embed/|live/|/v/|/e/|/w/|watch/)([A-Za-z0-9_-]{11})"). For https://youtu.be/jNQXAC9IVRw?si=AbCdEfGhIjKlMnOp it returns jNQXAC9IVRw, and Vi.ki ran the same pattern on Nov 20, 2026 over 22 forms of video link, from m.youtube.com to attribution_link, with the right ID every time. With a column of IDs, ="https://www.youtube.com/watch_videos?video_ids="&TEXTJOIN(",",TRUE,B2:B51) turns up to 50 of them into one playlist link (Make a Playlist From Video IDs).
Next: what the playlist link accepts and where it stops, the same IDs in a player on your site or each ID's title and channel, no key needed. To skip the formula, paste the links into the YouTube Link Converter.
The pattern, part by part
| Part | What it does |
|---|---|
(?: ... ) |
A group that must match but is not returned |
v= |
The ID after watch?v=, also when v= comes after app=desktop& or list=...& |
v%3D |
The same, encoded, inside an attribution_link?u=/watch%3Fv%3D... |
youtu\.be/ |
The short link (Short Links youtu.be and yt.be); \. is a real dot |
shorts/, embed/, live/ |
A Short, the embed player (both youtube.com and youtube-nocookie.com) and a live link |
/v/, /e/, /w/, watch/ |
The older forms YouTube still answers (Every YouTube URL Format) |
([A-Za-z0-9_-]{11}) |
The ID: 11 characters from 64 letters, digits, - and _ (How Many YouTube Video IDs Are There), returned |
Everything after the ID (?si=, &t=90, &list=, &feature=share) is left behind, because the ID stops at 11 characters.
The same pattern in other tools
| Tool | Formula or line |
|---|---|
| Google Sheets | =REGEXEXTRACT(A2,"(?:v=|v%3D|youtu\.be/|shorts/|embed/|live/|/v/|/e/|/w/|watch/)([A-Za-z0-9_-]{11})") |
| Excel (Microsoft 365, Excel for the web) | The same with ,2 before the last bracket: =REGEXEXTRACT(A2,"...",2) |
| Python | re.search(r"(?:v=|v%3D|youtu\.be/|shorts/|embed/|live/|/v/|/e/|/w/|watch/)([A-Za-z0-9_-]{11})", url).group(1) |
Google Sheets returns the bracketed part when a pattern has one, and uses Google's RE2 rules (REGEXEXTRACT, Google Docs Editors Help, read Nov 20, 2026). Excel's REGEXEXTRACT returns the whole match unless its third argument is 2, "Return capturing groups from the first match as an array" (REGEXEXTRACT function, Microsoft Support, read Nov 20, 2026), so without the ,2 it hands back youtu.be/jNQXAC9IVRw instead of the ID.
What we tested
Run with Python's pattern engine on Nov 20, 2026, the ID jNQXAC9IVRw ("Me at the zoo") unless named:
| Link | Result |
|---|---|
https://www.youtube.com/watch?v=jNQXAC9IVRw |
jNQXAC9IVRw |
youtube.com/watch?v=jNQXAC9IVRw (no https) |
jNQXAC9IVRw |
https://m.youtube.com/watch?v=jNQXAC9IVRw |
jNQXAC9IVRw |
.../watch?app=desktop&v=jNQXAC9IVRw |
jNQXAC9IVRw |
https://youtu.be/jNQXAC9IVRw?si=AbCdEfGhIjKlMnOp |
jNQXAC9IVRw |
https://youtu.be/jNQXAC9IVRw?t=10 |
jNQXAC9IVRw |
.../watch?v=jNQXAC9IVRw&t=10s |
jNQXAC9IVRw |
.../watch?v=jNQXAC9IVRw&list=PLbpi6...&index=1 |
jNQXAC9IVRw |
.../watch?list=PLbpi6...&v=jNQXAC9IVRw |
jNQXAC9IVRw |
https://www.youtube.com/shorts/0HAETg7L15o |
0HAETg7L15o |
https://youtube.com/shorts/0HAETg7L15o?feature=share |
0HAETg7L15o |
.../embed/jNQXAC9IVRw?start=5 |
jNQXAC9IVRw |
https://www.youtube-nocookie.com/embed/jNQXAC9IVRw |
jNQXAC9IVRw |
https://www.youtube.com/live/4t4AQ15yj1M?si=x |
4t4AQ15yj1M |
.../v/jNQXAC9IVRw, .../e/..., .../w/..., .../watch/... |
jNQXAC9IVRw (four links) |
https://music.youtube.com/watch?v=jNQXAC9IVRw&feature=share |
jNQXAC9IVRw |
.../attribution_link?u=/watch%3Fv%3DjNQXAC9IVRw |
jNQXAC9IVRw |
.../watch?v=jNQXAC9IVRw&feature=youtu.be |
jNQXAC9IVRw |
https://www.youtube.com/@jawed |
No match: a channel, not a video |
.../playlist?list=PLbpi6... |
No match: a playlist |
https://youtu.be/@LofiGirl |
No match |
jNQXAC9IVRw on its own |
No match: nothing to look after |
The no-match rows are what you want: a channel or playlist link in the list shows as an error instead of a wrong ID that would break the playlist link (one bad ID made watch_videos drop the whole list again in our Nov 20, 2026 request). A cell that already holds a bare ID needs =IFERROR(REGEXEXTRACT(...),A2) around the formula to keep it.
A Short's ID is the same ID the watch page uses. Freedom!'s Sep 14, 2023 video turns a Short into a regular video by replacing "shorts" with "watch" in its address and keeping the rest, which is why shorts/ and v= can sit side by side in one pattern.
From links to a playlist link
- Paste the links in column A, one per row, from A2 down.
- In B2 type the Google Sheets formula above and fill it down.
- In C1 type
="https://www.youtube.com/watch_videos?video_ids="&TEXTJOIN(",",TRUE,B2:B51). - Open the address in C1. YouTube answers with a redirect to
watch?v=<first ID>&list=TLGG..., the new list.
On Nov 20, 2026 the three-ID link this builds opened an "Untitled List" of 3, and a 60-ID link opened a list of 50, the cap Make a Playlist From Video IDs records, so stop the range at B51.
Where we disagree
Tongbos_EN's Oct 6, 2022 tutorial, the first match when Vi.ki searched YouTube for the task on Nov 20, 2026, uses REGEXEXTRACT with a pattern that takes everything after the = sign. That works on a bare watch?v=ID link and nothing else: on watch?v=ID&t=10s it returns ID&t=10s, on a youtu.be link (no =) it returns an error, and on a youtu.be link with ?si= it returns the share code instead of the ID. Matching the 11 ID characters themselves, as above, avoids all three.
Sources
- REGEXEXTRACT, Google Docs Editors Help, read Nov 20, 2026
- REGEXEXTRACT function, Microsoft Support, read Nov 20, 2026
- Quickly convert any YouTube Short to a video in 1-step: Replace "shorts" with "watch" in the URL!, Freedom!, Sep 14, 2023 (video)
- How to Extract Video ID from Youtube URL in Google Sheets, Tongbos_EN, Oct 6, 2022 (video)
- Vi.ki's run of the pattern over 26 links in Python, and its requests to youtube.com/watch_videos with 3 and 60 IDs, signed out, Nov 20, 2026
Moments
Quickly convert any YouTube Short to a video in 1-step: Replace "shorts" with "watch" in the URL!
Freedom!
How to Extract Video ID from Youtube URL in Google Sheets
Tongbos_EN
See also
-
Make a Playlist From Video IDsThe address youtube.com/watch_videos?video_ids= followed by video IDs separated by commas opens those videos as a temporary unlisted playlist, with no sign-in. In Vi.ki's test on Nov 11, 2026 it kept the first 50 IDs, and one wrong ID dropped the whole list.
-
Embed a Playlist of Video IDsTo embed several YouTube videos as one player without making a playlist, put the first video's ID in the embed address and the rest after ?playlist=, separated by commas, as youtube.com/embed/ID1?playlist=ID2,ID3. Google's embed reference documents it; a saved playlist uses embed/videoseries?list= instead. -
Video Title Without an API KeyThe address youtube.com/oembed?url= followed by a video's link and &format=json returns the video's title, channel name, channel address, thumbnail and embed code as JSON, with no API key and no sign-in. It does not return views, likes, the date or the length.
-
YouTube Link ConverterPaste any YouTube links and get each video's 11-character ID, its youtu.be short link with the start time kept, the normal-player watch link (which plays a Short with a seek bar) and watch_videos playlist links of up to 50 videos each. It runs in your browser and sends the links nowhere.
-
Short Links youtu.be and yt.beyoutu.be/VIDEO_ID is YouTube's short link for any video and accepts ?t= for a start time; yt.be is a second YouTube domain used only for named campaign links that YouTube itself creates, so yt.be/VIDEO_ID and yt.be/@handle do not work.
-
Every YouTube URL FormatEvery address form YouTube answers for videos, channels, playlists and lookups, each requested on Nov 19, 2026 with what came back. Eleven video forms all lead to youtube.com/watch?v=ID, the one address YouTube names as canonical for an ordinary video; five channel forms all lead to youtube.com/channel/ID.