The GitHub Social Preview size (1280×640px)
GitHub lets you set a social preview image on a repository, and it recommends 1280x640 pixels at a 2:1 ratio. This is the card that appears when someone shares your repo link on X, Slack, Discord, LinkedIn, or in a chat, so instead of a generic GitHub icon, your project gets a branded thumbnail with its name, logo, or a tagline, which noticeably improves click-through when your work is shared.
The 2:1 shape follows the open-graph card convention that most platforms use for link previews, and sizing to exactly 1280x640 ensures the image displays fully without those platforms cropping the top and bottom. GitHub notes an upper limit of around 1MB for the preview image, so a clean, optimized 1280x640 export that stays under that keeps the upload smooth while still looking sharp on high-resolution displays.
Because a preview card is scanned quickly in a busy feed or channel, keep it simple and legible: the repository or project name large, maybe a short tagline and a logo, with strong contrast and comfortable margins so nothing important sits where a platform might crop or overlay it. Consistent preview cards across your projects make an organization's repos feel like a coherent product family. Everything here resizes 100% in your browser with no upload and for free, so your image stays private on your device. GitHub can change its preview handling, so verify the current recommendation before setting it.