Product
Developers
Docs Pricing Blog Startups FREE Star on GitHub20

Guide

Logos for dark background API: the right logo on a dark page, by domain

Put /dark/ before a domain. You get the brand’s own dark-background file when it has one, or a version that stays readable on dark.

Alon Harpaz
Alon Harpaz, Founder of LogoAPI.sh Updated · 6 min read
Contents

For a company logo that shows on a dark background, use https://logoapi.sh/dark/<domain>.svg. It returns the brand’s official dark-background file when the brand publishes one. If not, it turns only the colours that would vanish on dark into white, or keeps the original when nothing would vanish. Free, no key.

Most logo APIs give you one file. That file was drawn for a white page. Put it on a dark hero, a dark dashboard or a dark email footer, and black wordmarks disappear. GitHub, Vercel, X and Notion all draw in black. On a dark page they turn into empty space.

The usual fixes are poor. You can invert the image with a CSS filter, but that turns Slack’s purple into green. You can put each logo on a white card, but that breaks the dark design. You can download a dark version for each brand by hand, but that does not scale past ten logos. The /dark/ route does that work for you, per brand, at request time.

Short answer

Change one path segment:

<!-- light page -->
<img src="https://logoapi.sh/github.com.svg" alt="GitHub" height="32">

<!-- dark page -->
<img src="https://logoapi.sh/dark/github.com.svg" alt="GitHub" height="32">

No key. No signup. No attribution. 2M requests a month per site. Free. The same works for the square icon: /dark/icon/github.com.svg.

See it on a dark tile

Each tile is #202124, the same dark grey the rule tests against. Top half: the normal logo URL. Bottom half: the /dark/ URL. Both load live.

normalGitHub, normal logo on dark
/dark/GitHub, dark-background version
github.com · white
normalVercel, normal logo on dark
/dark/Vercel, dark-background version
vercel.com · white
normalNotion, normal logo on dark
/dark/Notion, dark-background version
notion.so · official
normalStripe, normal logo on dark
/dark/Stripe, dark-background version
stripe.com · original
normalSlack, normal logo on dark
/dark/Slack, dark-background version
slack.com · partial
normalX, normal logo on dark
/dark/X, dark-background version
x.com · white

How it works

Every /dark/ request runs the same steps, in this order. The first step that matches wins.

  1. The brand’s own dark file.If the brand publishes a logo for dark backgrounds, we serve that file untouched. No recolouring.
  2. The logo already brings its own background.If the file starts with a full-size dark box behind the mark, or carries its own colour-scheme styles, it already works on dark. You get the original.
  3. Every colour is too dark.Each colour is checked against #202124. Under 3:1 contrast counts as too dark. If all of them fail, the whole logo turns white. For a few multi-part marks, where white would merge the parts, it turns light grey instead.
  4. Some colours are too dark, and the logo is wide.On a wordmark (at least 1.5 times wider than tall), only the failing colours turn white. The brand colours that pass stay as they are.
  5. Anything else.If no colour fails, or a square icon mixes passing and failing colours, you get the original file. A small dark detail on a square icon is better than a wrong colour.

One extra guard: a logo that already has white parts, like a white letter inside a black badge, is never turned all white. That would melt it into one blob. In that case only plain dark greys and blacks can change, not saturated brand colours.

Why 3:1?WCAG asks for at least 3:1 contrast for graphics people need to see. We test each colour on its own against the dark tile, not an average of the whole logo.

Which file you get

Every response tells you which step ran, in the X-Logo-Variant header. Check it with one request:

curl -sI https://logoapi.sh/dark/github.com.svg | grep -i x-logo-variant
Values of X-Logo-Variant on /dark/ routes
Header valueWhat you got
officialThe brand’s own dark-background file, untouched
originalThe normal logo; it already reads on dark
whiteAll colours were too dark; the logo is white
partialWide logo; only the failing colours are white
grey-fallbackMulti-part mark; light grey keeps the parts apart

Compared with other logo APIs

Here is how dark-background logos work on the services developers ask about most.

LogoAPI.sh from its code and docs, Nov 4, 2026. Rival cells from their official docs and live requests, checked Nov 4, 2026.
LogoAPI.sh Logo.dev Brandfetch Simple Icons
Dark option/dark/ in the paththeme=dark, with format=png or webp/theme/light for dark backgrounds. Careful: /theme/dark is the dark logo, for light backgroundsAny one colour: /github/ffffff
Brand’s own dark fileYes, when the brand publishes oneNot in the docs; they describe a colour changeLight and dark versions; brands can claim and edit their profileNo, one-colour icons only
How dark worksKeeps brand colours; only colours under 3:1 changeRecolours for dark: lightens dark logos, inverts single-colour marksPicks a stored light or dark versionNo brand colours; one colour
SVGYesNot on the CDN. The Brand API downloads PNG, JPG or WebPLogo and symbol types onlyYes
Look up byDomainDomainDomainSlug, not domain
KeyNonePublishable keyClient IDNone

Google’s favicon service has no dark option. For small icons in a dark browser tab, see our free favicon API and its ?theme=auto switch.

Use it in your code

Follow the visitor’s theme

The browser picks the right file. No JavaScript.

<picture>
  <source media="(prefers-color-scheme: dark)"
          srcset="https://logoapi.sh/dark/stripe.com.svg">
  <img src="https://logoapi.sh/stripe.com.svg" alt="Stripe" height="32">
</picture>

A theme switch on your site

If your site has its own light and dark toggle, swap the path in your component:

const logo = (domain, dark) =>
  `https://logoapi.sh/${dark ? "dark/" : ""}${domain}.svg`;

<img src={logo("notion.so", theme === "dark")} alt="Notion" height={32} />

A dark-only section

For a dark hero or footer on an otherwise light page, just use the /dark/ URL in that section. Always set alt to the company name, so screen readers say who it is.

Edge cases

  • Missing brand. You get a name tile drawn for dark: white text on #202124. Add ?fallback=404 to get a 404 instead.
  • PNG logos. Raster files are never recoloured. A brand with a PNG wordmark and an SVG icon returns the original PNG from /dark/<domain>.svg, with X-Logo-Variant: original; its icon at /dark/icon/<domain>.svg works as normal. A brand with only a PNG logo gets a 404 with raster_only on /dark/. The format field in /search tells you which you have.
  • A logo still looks wrong. Rules cannot know every brand. Claim the brand and send its official dark file; that file then wins step 1.
  • Caching. A new logo file changes the dark version at the next deploy. You do not need to purge anything.

Want white, black or grey on every logo instead? Use /white/, /black/ or /grey/. Those are one-colour versions, good for a strip of customer logos. /dark/ is the one that tries to keep the brand’s colours.

FAQ

Is there a free API for logos on a dark background?

Yes. Put /dark/ before the domain: logoapi.sh/dark/stripe.com.svg. No key, no signup, no attribution. 2M requests a month per site. Free.

Does it use the brand’s own dark logo?

Yes, when the brand publishes one. That file is served untouched and the header X-Logo-Variant says official. Otherwise the contrast rule runs.

What contrast does the dark version meet?

Each colour is tested against #202124. A colour under 3:1 counts as too dark. If every colour fails, the logo turns white. On wide logos with mixed colours, only the failing colours turn white.

Will it ever change a logo that already works on dark?

No. If no colour fails the 3:1 test, you get the original file. Logos with their own dark background box are also left as they are.

How do I switch logos with the site theme?

Use a <picture> element: a source with media="(prefers-color-scheme: dark)" pointing at the /dark/ URL, and an img with the normal URL.

What if the brand is missing?

You get a name tile drawn for a dark background: white text on #202124. Add ?fallback=404 to get a 404 instead.

Disclosure: we build LogoAPI.sh. Rival facts from each provider’s own pages; terms change, so check theirs before you decide. Logos are trademarks of their owners.

Found this useful? Share it.