Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save a1ip/be4514c1fd392a8c13b05e082c4da363 to your computer and use it in GitHub Desktop.

Select an option

Save a1ip/be4514c1fd392a8c13b05e082c4da363 to your computer and use it in GitHub Desktop.
YouTube video thumbnails sizes and formats

Note: YouTube is serving thumbnails from 2 servers:

  • //img.youtube.com
  • //i.ytimg.com

Examples are with //i.ytimg.com server just because it’s shorter, no other particular reason. You can use both.

  • Player Background Thumbnail (480x360):

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/0.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/0.jpg
    
  • Video frames thumbnails (120x90)

    WebP:
    Start: //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/1.webp
    Middle: //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/2.webp
    End: //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/3.webp
    
    JPG:
    Start: //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/1.jpg
    Middle: //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/2.jpg
    End: //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/3.jpg
    
  • Lowest quality thumbnail (120x90)

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/default.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/default.jpg
    
  • Medium quality thumbnail (320x180)

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/mqdefault.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/mqdefault.jpg
    
  • High quality thumbnail (480x360)

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/hqdefault.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/hqdefault.jpg
    
  • Standard quality thumbnail (640x480)

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/sddefault.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/sddefault.jpg
    
  • Unscaled thumbnail resolution

    WebP
    //i.ytimg.com/vi_webp/<YouTube_Video_ID_HERE>/maxresdefault.webp
    
    JPG
    //i.ytimg.com/vi/<YouTube_Video_ID_HERE>/maxresdefault.jpg
    
@tiagofrancafernandes
Copy link

Amazing!

@doctoon
Copy link

doctoon commented Jan 12, 2026

this is a bit old but there's also animated previews

https://i.ytimg.com/an_webp/[video id]/mqdefault_6s.webp?du=3000&sqp=[protobuf timestamp]&rs=AOn4CL[a 28-byte url-safe hash that includes the video id and other parameters]

sqp is just a unix timestamp that's 1-2 hours into the past or future, im not sure why this is the case.
both parameters are cached for 6 hours, in that timeframe hovering over a video with the same video id would result in the same hash and the same timestamp.

rs however is a bit more complex
tried it on incognito to confirm the hashing algorithm isnt fed a session specific token.
i'd assume its the video id of the hovered video, the video id of your current video, and 1-2 other things.

my best guess is that its a 168 bit sha-1 hash

unfortunately all parameters are required, so maybe it was excluded on purpose, but i just wanted to mention it here because i like fun facts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment