Blog
Wild & Free Tools

YouTube Thumbnail URL Structure — Get Any Size Without a YouTube data source Key

Last updated: February 2026 6 min read
Quick Answer

Table of Contents

  1. The complete URL pattern for all 5 sizes
  2. Extracting the video ID from different URL formats
  3. Checking if maxresdefault exists programmatically
  4. WebP variant URLs
  5. Using thumbnail URLs in spreadsheets
  6. Frequently Asked Questions

YouTube thumbnails are hosted at public CDN URLs with a completely predictable structure: https://i.ytimg.com/vi/VIDEO_ID/FILENAME.jpg. You don't need a YouTube data source key, OAuth, or any credentials to fetch them — just the video ID. If you want a quick no-code way to grab thumbnails without constructing URLs manually, the YouTube Thumbnail Downloader does it visually. But if you're building something, here's the full URL spec.

The Complete URL Pattern for All 5 Thumbnail Sizes

YouTube serves thumbnails at five fixed sizes. Here are all five URLs for a given video ID (VIDEO_ID is the 11-character identifier):

QualityFilenameDimensionsFull URL
Max HDmaxresdefault.jpg1280x720https://i.ytimg.com/vi/VIDEO_ID/maxresdefault.jpg
SDsddefault.jpg640x480https://i.ytimg.com/vi/VIDEO_ID/sddefault.jpg
HQhqdefault.jpg480x360https://i.ytimg.com/vi/VIDEO_ID/hqdefault.jpg
MQmqdefault.jpg320x180https://i.ytimg.com/vi/VIDEO_ID/mqdefault.jpg
Defaultdefault.jpg120x90https://i.ytimg.com/vi/VIDEO_ID/default.jpg

Replace VIDEO_ID with the actual video identifier. For https://www.youtube.com/watch?v=dQw4w9WgXcQ, the ID is dQw4w9WgXcQ. For https://youtu.be/dQw4w9WgXcQ, it's the same string after the slash.

One caveat: maxresdefault doesn't exist for all videos. YouTube started generating it widely around 2013-2014. For older or small-channel videos, the URL resolves to a tiny gray placeholder rather than a 404. Always check for the gray placeholder if you're consuming this programmatically. More detail in the maxresdefault guide.

Extracting the Video ID From Different URL Formats

YouTube uses several URL formats. Here are regex patterns to extract the video ID from each:

// JavaScript — extract video ID from any YouTube URL
function getVideoId(url) {
  const match = url.match(
    /(?:v=|youtu\.be\/|embed\/|shorts\/)([a-zA-Z0-9_-]{11})/
  );
  return match ? match[1] : null;
}

// Examples:
// youtube.com/watch?v=dQw4w9WgXcQ     -> dQw4w9WgXcQ
// youtu.be/dQw4w9WgXcQ                -> dQw4w9WgXcQ
// youtube.com/shorts/dQw4w9WgXcQ      -> dQw4w9WgXcQ
// youtube.com/embed/dQw4w9WgXcQ       -> dQw4w9WgXcQ

And the Python equivalent:

import re

def get_video_id(url):
    match = re.search(
        r'(?:v=|youtu\.be/|embed/|shorts/)([a-zA-Z0-9_-]{11})',
        url
    )
    return match.group(1) if match else None

def get_thumbnail_url(video_id, quality='maxresdefault'):
    return f'https://i.ytimg.com/vi/{video_id}/{quality}.jpg'

The valid quality strings are: maxresdefault, sddefault, hqdefault, mqdefault, default.

Sell Custom Apparel — We Handle Printing & Free Shipping

Checking If maxresdefault Exists (Without Downloading a Placeholder)

The gray placeholder that YouTube returns when maxresdefault doesn't exist is 120x90 pixels and weighs about 1-2KB. A real HD thumbnail is usually 40-200KB. You can check without fully downloading the image using a HEAD request and checking the Content-Length header, or by downloading and checking image dimensions.

# Python — check if maxresdefault exists
import requests
from PIL import Image
from io import BytesIO

def has_maxres(video_id):
    url = f'https://i.ytimg.com/vi/{video_id}/maxresdefault.jpg'
    resp = requests.get(url, timeout=10)
    img = Image.open(BytesIO(resp.content))
    # Gray placeholder is 120x90; real HD thumbnail is 1280x720
    return img.size[0] > 200  # anything wider than 200px is a real thumbnail

# Or just check Content-Length from a HEAD request
def has_maxres_fast(video_id):
    url = f'https://i.ytimg.com/vi/{video_id}/maxresdefault.jpg'
    resp = requests.head(url, timeout=5)
    length = int(resp.headers.get('Content-Length', 0))
    return length > 5000  # placeholder is < 2KB

If you're running this at scale, add reasonable delays between requests — YouTube's CDN will rate-limit aggressive batch requests. For a no-code bulk approach, use the visual tool for small batches.

WebP Variants — Smaller Files, Same Content

YouTube's CDN also serves WebP versions of thumbnails at a slightly different URL pattern:

https://i.ytimg.com/vi_webp/VIDEO_ID/maxresdefault.webp

Note the vi_webp path segment instead of vi, and .webp extension instead of .jpg. WebP files are typically 25-35% smaller than their JPEG equivalents at comparable quality, which matters if you're serving thumbnails in your own application.

Availability is similar to the JPEG versions — not every video has a maxresdefault WebP, but hqdefault WebP is generally available. The same five quality levels apply. For web applications serving thumbnail images, the WebP variant is worth using if your browser support requirements allow it.

Building Thumbnail URL Lists in Google Sheets or Excel

If you have a list of video IDs in column A and want to generate all thumbnail URLs:

=CONCATENATE("https://i.ytimg.com/vi/",A2,"/maxresdefault.jpg")

For a clickable image formula in Google Sheets:

=IMAGE("https://i.ytimg.com/vi/"&A2&"/hqdefault.jpg")

This renders the actual thumbnail image inside the cell — useful for visual verification of a batch of video IDs. The hqdefault variant is safer here than maxresdefault because it always exists.

If you need to get all video IDs from a channel first, the YouTube Channel Video Links Extractor exports a CSV with video IDs, titles, and URLs. Drop the ID column into your spreadsheet and use the formula above.

For interactive visual thumbnail browsing rather than a spreadsheet, the thumbnail downloader handles it without any formula work.

Try the Visual Thumbnail Downloader

Paste a video URL and see all 5 thumbnail sizes at once — no code required. Free, private, instant.

Open YouTube Thumbnail Downloader

Frequently Asked Questions

Do I need a YouTube data source key to get thumbnails?

No. YouTube thumbnails are served from a public CDN (i.ytimg.com) that requires no authentication. You don't need an API key, OAuth credentials, or any YouTube account. Just construct the URL with the video ID and fetch it like any other public image.

Are thumbnail URLs stable? Will they break if I store them in a database?

YouTube thumbnail CDN URLs are generally stable for as long as the video exists. Deleted videos will result in the CDN returning placeholder images. Live stream thumbnails may change during the stream. For most use cases, storing the URL with the video ID and a fallback to hqdefault is a reliable approach.

Can I fetch YouTube thumbnails from a browser using JavaScript without CORS issues?

YouTube's thumbnail CDN (i.ytimg.com) does not serve CORS headers that allow cross-origin image requests from web pages. You can display thumbnail images as HTML img tags (CORS doesn't apply to standard image loads), but you cannot fetch the image data with fetch() or XMLHttpRequest from a browser without a proxy. For server-side code, there's no CORS restriction.

What if the video uses a custom thumbnail that's been updated?

YouTube CDN URLs always serve the current thumbnail for a video. If a creator updates their thumbnail, the same URL will serve the new image after CDN propagation (usually within a few hours). If you've cached the old image locally, you'll need to re-fetch. There's no versioning in the URL — just the one current image per quality level.

Chris Hartley
Chris Hartley SEO & Marketing Writer

Chris has been in digital marketing for twelve years covering SEO tools and content optimization.

More articles by Chris →
Launch Your Own Clothing Brand — No Inventory, No Risk