Launch offerExploreTry on
Pricing
Launch offerOfferSign inStart
Launch offer · until Sun, Oct 25Until Sun, Oct 252 Marks and a year of Pro for $99See the launch offer and new MarksSee the offer
Field GuideSocial media
Social media

GitHub social preview image: size, safe area and design

When someone shares your repo, one small card decides whether they click. Here is the size GitHub wants, where it goes, and how to design it to survive every crop.

GradientlyVerified Gradiently account·October 19, 2026·7 min read
Cover: Sand Hearth · GR·1C0K·KG

The short version

  • The GitHub social preview image should be 1280×640 pixels, with a minimum of 640×320 and a file under 1 MB in PNG, JPG or GIF.
  • You upload a repository's social preview in Settings, on the General page, under Social preview.
  • GitHub publishes the social preview as the repository page's Open Graph image, so X, LinkedIn, Slack and chat apps all use it.
  • A good social preview shows only the project name, one line about what it does, and a solid or gradient ground, with the name inside the centre square.
  • If an old preview still appears after you upload a new one, the sharing platform has cached it, and a fresh fetch or a new URL fixes it.
On this page
GitHub social preview size and file rulesWhere to upload a social preview on GitHubSafe area: what survives every cropWhat to show on a GitHub social previewWhy your GitHub social preview doesn't updateHow the social preview relates to OG imagesMake a GitHub social preview in Gradiently

A GitHub social preview is the image people see when your repository link is shared on X, LinkedIn, Slack, Discord or in a chat. GitHub asks for a PNG, JPG or GIF under 1 MB, at least 640×320 pixels, and recommends 1280×640 for the best display. You upload it in the repository's Settings › General › Social preview, and GitHub then serves it as the repo's Open Graph image.

GitHub social preview 1280×640

1280 × 640

Minimum 640×320

640 × 320

Open Graph 1200×630

1200 × 630

The recommended size, the minimum GitHub accepts, and the standard Open Graph card. GitHub's image is a clean 2:1; Open Graph is about 1.91:1.

GitHub social preview size and file rules

Design at 1280×640. It is exactly 2:1, which matches the large card on X and sits close to the 1.91:1 card most other platforms draw. Treat 640×320 as a floor: it looks soft on high density screens.

Recommended size

Value

1280×640 px

Why it matters

Sharp on high density screens, exact 2:1 ratio
Minimum size

Value

640×320 px

Why it matters

Anything smaller is rejected or looks blurry
File types

Value

PNG, JPG or GIF

Why it matters

Use PNG for type and flat colour, JPG for photos
File weight

Value

Under 1 MB

Why it matters

GitHub refuses larger uploads
Transparency

Value

Supported in PNG

Why it matters

Risky: the card colour behind it changes per app and per theme
Who sees it

Value

Public repositories

Why it matters

Private repos only keep an image uploaded earlier
RuleValueWhy it matters
Recommended size1280×640 pxSharp on high density screens, exact 2:1 ratio
Minimum size640×320 pxAnything smaller is rejected or looks blurry
File typesPNG, JPG or GIFUse PNG for type and flat colour, JPG for photos
File weightUnder 1 MBGitHub refuses larger uploads
TransparencySupported in PNGRisky: the card colour behind it changes per app and per theme
Who sees itPublic repositoriesPrivate repos only keep an image uploaded earlier
GitHub's documented rules for the repository social preview, with the reason each one matters in practice.

A designed card with a gradient ground and a few words comes in well under 1 MB as a PNG. If yours does not, it is usually a photo or heavy noise layer; image compression and PNG vs JPEG cover how to bring it down without visible damage.

Skip the transparent PNG

GitHub accepts transparency, but the card behind your image is white in one app, near black in another, and flips with dark mode. A transparent logo that reads on one disappears on the other. Give the image its own solid or gradient ground.

Where to upload a social preview on GitHub

  1. 1

    Open the repository settings

    Go to the repository's main page and click Settings. If the tab is hidden, open the … menu at the end of the tab row.

  2. 2

    Find Social preview

    On the General page, scroll to Social preview. Without an image, GitHub shows a generated card with the repo's name, description, a few stats and the owner's avatar.

  3. 3

    Upload the image

    Click Edit, then Upload an image…, and choose your 1280×640 PNG.

  4. 4

    Test a fresh share

    Paste the repo URL into a new post or chat. If you see the old card, that platform has cached it; see the section on updates below.

To go back to GitHub's generated card, use Edit › Remove image in the same place.

Safe area: what survives every crop

GitHub does not publish a safe area, but the platforms that show your image do crop it. A 2:1 image shown in a 1.91:1 card loses roughly 30 pixels from each side. Some chat apps and mobile layouts crop link images to a square from the centre, which leaves only the middle 640×640. And everything gets small: in a feed the whole card is often a few hundred pixels wide.

Full image 1280×640

1280 × 640

1.91:1 card 1220×640

1220 × 640

Centre square 640×640

640 × 640

The full upload, what remains in a standard 1.91:1 link card, and the centre square some apps keep. Put the repo name inside the square.
  • Margins of at least 64 px on every edge, so nothing touches a crop or a rounded corner.
  • The project name inside the centre 640×640, so a square crop still says what it is.
  • Type tall enough to read small: a name around 96 to 140 px and a line around 40 to 56 px on the 1280×640 canvas.
  • Nothing important in the corners, where cards round off and some apps overlay a play or site badge.

What to show on a GitHub social preview

Three things, and nothing more: the project name, one line that says what it does, and a ground that is recognisably yours. The card already shows the URL, so skip the owner, star counts and feature lists. Code screenshots turn to grey noise at card size.

Tidewater
Fast diffing for large JSON files
Gradiently · @gradiently

Name and one line on a calm ground: it reads at feed size and survives a square crop.

Tidewater

The same project with only its name: bolder, but the card has to explain what it does.

Avoid

  • A screenshot of the README or the code
  • Star counts and badges that go stale
  • The logo alone on a transparent background
  • Small text near the edges
  • A different look from your site and docs

Do

  • The project name, large and centred
  • One line in plain words: what it does
  • A solid or gradient ground that works in light and dark apps
  • 64 px margins and the name inside the centre square
  • The same ground as your README banner and site

Share one ground across the README banner, docs and social preview so a shared link looks like the project people met on GitHub. Open source project branding covers building that small system around one ground.

Why your GitHub social preview doesn't update

GitHub switches the image on the repository page as soon as you upload it. The old card you still see elsewhere is a cache: X, LinkedIn, Slack, Discord and messaging apps fetch a link's preview once and reuse it, sometimes for days. Old posts keep their old card for good.

  • LinkedIn: paste the repo URL into the LinkedIn Post Inspector to fetch it again.
  • Everywhere else: share a URL the platform has not seen, such as the repo link with a harmless query on the end (?v=2). It is a new address to the crawler, so it fetches a fresh preview.
  • Check GitHub first: open the repo in a private window and confirm Settings shows the new image. If it does, the problem is the platform's cache, not your upload.
  • Still blank? The repository may be private; GitHub only shares social previews for public repos.

The same fixes apply to any site's link previews. OG image not showing is the full checklist.

How the social preview relates to OG images

The social preview is an Open Graph image. GitHub writes it into the repo page's og:image tag, with a large card setting for X, so every platform reads it the same way it reads yours. You cannot edit those tags on github.com, which is why the upload exists.

html
<!-- Roughly what GitHub serves in the head of a public repo page -->
<meta property="og:title" content="tidewater-dev/tidewater" />
<meta property="og:description" content="Fast diffing for large JSON files." />
<meta property="og:image" content="https://repository-images.githubusercontent.com/..." />
<meta property="og:url" content="https://github.com/tidewater-dev/tidewater" />
<meta name="twitter:card" content="summary_large_image" />
The tags a crawler reads from a repository page. Your uploaded image becomes the og:image; the description comes from the repo's About field.

For your project's own website, you set these tags yourself, usually with a 1200×630 image. Design the two as a pair: same ground, same name, same line, at 1280×640 for GitHub and 1200×630 for the site. With good margins, one layout fits both. OG image size and Open Graph tags cover the site side, and dynamic OG images shows how to generate one per docs page.

Make a GitHub social preview in Gradiently

In the Studio, start a design at a custom size of 1280×640 and pick a Mark as the ground. Set the project name and one line; the Mark keeps its calmest region behind the words and Auto ink picks light or dark type from its palette, so it reads in both light and dark apps. Export as PNG and upload it in Social preview. For the matching site card, add the built-in Link preview (Open Graph) 1200×630 size to the same design so both share one ground.

Tidewater
Fast diffing for large JSON files

The site's 1200×630 Open Graph card cut from the same design as the GitHub image, so the repo and the site share one look.

Design with a living gradient

Posts, stories, slides and banners in every size, with text that always reads.

Start designing, free

Questions people ask

What size is the GitHub social preview image?

GitHub recommends 1280×640 pixels and requires at least 640×320. The file must be a PNG, JPG or GIF under 1 MB.

Where do I change the social preview on GitHub?

Open the repository, click Settings, and on the General page find Social preview. Click Edit, then Upload an image.

Why is my GitHub social preview not updating?

The platform you shared on has cached the old card. Refresh it with a tool like LinkedIn Post Inspector, or share the URL with a query such as ?v=2 so it is fetched fresh.

Can I use a transparent PNG for a GitHub social preview?

GitHub accepts it, but the card behind it changes colour between apps and with dark mode, so a solid or gradient background is safer.

Is the GitHub social preview the same as an OG image?

Yes. GitHub puts your uploaded image in the repository page's og:image tag, which is what every platform reads for link previews.

Share this guide

Written by GradientlyVerified Gradiently account

The team behind Gradiently, a design tool built around Marks: living gradients that make everything you design look like yours.

See our profile

On this page

GitHub social preview size and file rulesWhere to upload a social preview on GitHubSafe area: what survives every cropWhat to show on a GitHub social previewWhy your GitHub social preview doesn't updateHow the social preview relates to OG imagesMake a GitHub social preview in Gradiently

Share this guide

Next in Social media

Product Hunt gallery images: a sequence that tells the story

Keep reading

All Social media guides
Social media

Link previews: why your shared links look broken, and the fix

6 min read

You paste your link into a chat and get a grey box, the wrong picture or a logo cropped in half. Almost every broken preview comes down to one of eight causes, and all of them are fixable in minutes.

Social media

Social media image sizes: the complete cheat sheet

5 min read

Every platform wants a different shape, and a design that fits one gets cropped on the next. Here is every size you need, the few shapes behind them, and how to keep one look across all of them.

Social media

OG image size: 1200×630 link previews that work everywhere

6 min read

Every time someone pastes your link, a small picture decides whether anyone clicks it. Here is the size, the tags and the layout that make that picture work.

Find the look that’s only yours.

Every Mark is a living background with one owner. Try an unclaimed Mark, and claim yours when it feels right.

Start designingSee the launch offer

Marks left to claim

50of 1,000

950 claimed so farFind yours

Check a certificate

Type a certificate number or a Mark’s code to see who owns it.

Works with ChatGPT and Claude

Ask your AI for a design. It makes it in your Mark, ready to edit.

ChatGPTClaude
How to connect

Product

  • Launch packs
  • Explore
  • Pricing
  • Certificates

Learn

  • Field Guide
  • Help centre
  • What’s new

Developers

  • Overview
  • ChatGPT and Claude
  • API reference
  • API keys

Company

  • About
  • Contact us
  • Sign in

Legal

  • Terms
  • Privacy
  • Refunds
  • Mark protection
  • Cookies
  • All policies
Move through the letters. Each one wears a real Mark.Touch a letter to see its Mark.One name. Ten Marks inside it.
© 2026 Gradiently