My Tool Studio
YouTube

YouTube Video ID Finder

This YouTube video ID finder pulls the 11-character video ID out of any YouTube link as you paste it. It reads watch links, youtu.be short links, Shorts, live and embed URLs, including links with playlist, timestamp or tracking parameters attached. Next to the ID you get a clean watch link with tracking such as si= removed, a short link, an embed URL, the start time, the playlist ID and a table of every query parameter. Developers use it to extract a YouTube video ID from a URL while debugging an import script. Social media managers use the Bulk tab to turn a spreadsheet column of links into a CSV of IDs. A timestamp builder makes a link that starts at any moment, and a copy-ready regex in JavaScript and Python is included for your own code.

Always freeNo sign upRuns in your browser
Regex to extract a YouTube video ID in your own code
JavaScript
const YT_ID = /(?:youtube(?:-nocookie)?\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/|live\/|v\/)|youtu\.be\/)([A-Za-z0-9_-]{11})/;

function getVideoId(url) {
  const m = url.match(YT_ID);
  return m ? m[1] : null;
}

getVideoId("https://youtu.be/dQw4w9WgXcQ?si=abc"); // "dQw4w9WgXcQ"
Python
import re

YT_ID = re.compile(r"(?:youtube(?:-nocookie)?\.com/(?:watch\?(?:.*&)?v=|embed/|shorts/|live/|v/)|youtu\.be/)([A-Za-z0-9_-]{11})")

def get_video_id(url):
    m = YT_ID.search(url)
    return m.group(1) if m else None

get_video_id("https://youtu.be/dQw4w9WgXcQ?si=abc")  # 'dQw4w9WgXcQ'

How to use

01

Paste a YouTube link

Paste into the YouTube URL field on the One link tab. Watch, youtu.be, Shorts, live and embed links all work, with or without https://. Try a sample link fills in an example.

02

Read and copy the results

Results appear instantly: Video ID, Clean link, Short URL, Embed URL, start time, playlist ID and a table of every query parameter. Type a time such as 1:30 under Timestamp link to get links that start there.

03

Process many links at once

Switch to the Bulk tab and paste up to 500 links, one per line. Lines with no ID are flagged. Use Copy IDs, Copy CSV or Download CSV to move the results into a spreadsheet.

Why YouTube Video ID Finder

Where the video ID sits in each YouTube URL

YouTube has several link formats, but every one that points to a single video carries the same 11-character ID. Only its position changes. The examples below all point to the same video, dQw4w9WgXcQ.

Anything after a ? or & that isn't v is extra information: a playlist, a start time or a tracking value. The ID itself never contains ? or &. Paste any of these into the tool to see the ID and each parameter split out.

Link typeExampleWhere the ID is
Watchyoutube.com/watch?v=dQw4w9WgXcQValue of v=
Mobile watchm.youtube.com/watch?v=dQw4w9WgXcQValue of v=
Short linkyoutu.be/dQw4w9WgXcQ?si=...First part of the path
Shortsyoutube.com/shorts/dQw4w9WgXcQAfter /shorts/
Liveyoutube.com/live/dQw4w9WgXcQAfter /live/
Embedyoutube.com/embed/dQw4w9WgXcQ?start=30After /embed/
In a playlistyoutube.com/watch?v=dQw4w9WgXcQ&list=PL...&index=2Value of v=; list= is the playlist

Extracting the ID in your own code

The regex in the tool matches the known path and parameter positions and captures exactly 11 characters. That is more reliable than splitting the string on = or /, which breaks on real-world links.

  • Don't assume v is the first parameter. Mobile share links often start with feature= and put v= later.
  • Strip the query string from youtu.be links, or si= will end up attached to the ID.
  • IDs can contain hyphens and underscores, so a pattern of only letters and digits will miss some.
  • Check the result is exactly 11 characters before storing it.
  • A regex can't tell you whether a video is public. Use the YouTube Data API or an oEmbed request if you need that.
  • Keep the original URL next to the ID if you need the timestamp or playlist later.

Common questions

How does the YouTube Video ID Finder pull the ID out of a link?
It checks the link against each known YouTube pattern: the v parameter on watch pages, the path on youtu.be, and the /shorts/, /live/ and /embed/ paths. Whichever matches, the same 11-character ID comes out. A bare ID with no URL around it is accepted too.
Which YouTube link formats can the video ID finder read?
Standard and mobile watch links, music.youtube.com watch links, youtu.be short links, Shorts, live and /embed/ URLs, and plain video IDs. Extra parameters such as si, feature and pp don't get in the way.
What is the si= parameter on YouTube share links?
YouTube adds si= to links copied from its Share button, and it is widely understood to identify the share. The video plays the same without it. The Clean link row drops si, feature, pp and similar values but keeps the playlist and start time.
Can the video ID finder read the timestamp from a shared link?
Yes. It reads t=42, t=42s and t=1m30s, plus start= from embed links. The time appears in seconds and as a clock value such as 1:30, and the short and embed URLs keep it.
Is a YouTube video ID always 11 characters?
Yes. Every video ID is 11 characters made of letters, digits, hyphens and underscores. If the tool cannot find an 11-character ID in a recognised position, it says so rather than guessing.
Can I extract video IDs from a list of YouTube links in bulk?
Yes. Paste up to 500 links, one per line, in the Bulk tab. The table shows each ID, start time and playlist, and you can copy just the IDs or download a CSV with the input, ID, start seconds, playlist ID and clean URL.
What happens if I paste a YouTube channel or playlist-only link?
No ID is found, because those links don't point to a single video. For a channel, use the YouTube Channel ID Finder to get its UC ID. A playlist link that also contains v= does work, and its playlist ID is shown too.
How do I make a YouTube link that starts at a certain time with the video ID finder?
Paste the video link, then type the time into Timestamp link as 90, 1:30 or 1m30s. You get a watch link with &t=90s, a youtu.be link with ?t=90 and an embed link with ?start=90. For a whole list of times, the YouTube Timestamp Link Generator makes every link at once.
Is there a regex to extract a YouTube video ID in JavaScript or Python?
Yes. Open the regex section at the bottom of the tool for copy-ready JavaScript and Python snippets. The pattern matches watch, youtu.be, Shorts, live, embed and youtube-nocookie links and captures the 11 characters after them. It does not check that the video exists.
Does the video ID finder check that the YouTube video still exists?
No. It only reads the link's text, so the ID of a deleted or private video still comes out. The thumbnail preview is a rough hint, because a missing video usually shows a grey placeholder.

More YouTube tools

View all