YouTube Thumbnail URL Generator

Paste a YouTube share/watch/short/embed URL. The tool extracts the 11-character video ID and creates common thumbnail URLs.

Enter a YouTube URL.
YouTube thumbnail preview

Extract the Video ID Top ↑

function getYouTubeId( input ) {
    let url;

    try {
        url = new URL( input );
    } catch ( error ) {
        return "";
    }

    const host =
        url.hostname.replace(
            /^www\./,
            ""
        );

    if ( host === "youtu.be" ) {
        return url.pathname
            .split( "/" )
            .filter( Boolean )[0] || "";
    }

    if (
        host === "youtube.com" ||
        host === "m.youtube.com"
    ) {
        if (
            url.pathname === "/watch"
        ) {
            return url.searchParams.get(
                "v"
            ) || "";
        }

        const parts =
            url.pathname
                .split( "/" )
                .filter( Boolean );

        if (
            [ "shorts", "embed", "v" ]
                .includes( parts[0] )
        ) {
            return parts[1] || "";
        }
    }

    return "";
}

Build Thumbnail URLs Top ↑

const base =
    "https://img.youtube.com/vi/" +
    videoId +
    "/";

const thumbnails = {
    default:
        base + "default.jpg",
    medium:
        base + "mqdefault.jpg",
    high:
        base + "hqdefault.jpg",
    standard:
        base + "sddefault.jpg",
    max:
        base + "maxresdefault.jpg"
};
maxresdefault.jpg is not available for every YouTube video. If the image does not exist, use one of the lower-resolution variants.

Video schema markup tutorial






plus2net.com






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer