Need a website that wins clients? Webteqno builds flat-price small business websites, live in 2–3 weeks. No retainer. Get a free quote →
Web formats

Logo PNG vs SVG for Your Website: Which File Should You Upload?

Your website header logo is loaded on every page, seen on every device and is often the first image a visitor sees. Choosing between SVG and PNG affects how sharp it looks, how fast the page loads, whether it adapts to dark mode — and, on WordPress, whether you can upload it at all.

By Wamiq Hussain · Published · Updated · 5 min read

Website header logo shown as a sharp SVG and a pixel-based PNG at high zoom

Short answer

Use SVG for your website logo if you have a genuine vector file: it is sharp at every size and screen density, usually only 2–10 KB, and can change colour for dark mode with CSS. Use PNG (or WebP) exported at 2× the display size if your logo is photographic, has complex effects, came only as a raster image, or your platform does not allow SVG uploads. Either way, set width and height attributes and never lazy-load the header logo.

Key takeaways

The core difference

A PNG is a grid of pixels. It looks perfect at its exact size, fine when scaled down, and soft when scaled up. To look sharp on a retina screen, it must contain at least twice as many pixels as the space it occupies.

An SVG (Scalable Vector Graphics) is a text file describing shapes: paths, fills and strokes. The browser draws it fresh at whatever size and density is needed, so it is sharp on a 4K monitor, a phone and a printout — from one file.

SVG vs PNG compared

SVGPNG
Sharpness on retina / zoomAlways sharpSharp only if exported at 2×–3× the display size
Typical header logo file size2–10 KB (simple logos)5–40 KB at 2×
TransparencyYesYes
Change colour with CSS (dark mode, hover)Yes, when inlined or using currentColorNo — needs a second file
Photographic / complex effectsPoor; files balloonGood
Browser supportAll modern browsersUniversal
Social media, email, marketplacesMostly not acceptedAccepted everywhere
CMS uploadOften blocked by defaultAlways allowed

When SVG is the right choice

Check that the SVG is real

Some SVG files are just a PNG wrapped in an SVG container — you get the downsides of both. Open the file in a text editor: a real vector has <path d="…"> elements; a fake one contains <image href="data:image/png;base64,…">. Another quick test: zoom the browser to 400% on the logo. A real SVG stays crisp.

Also check that text is converted to outlines. An SVG that uses <text> with your brand font will fall back to a system font on visitors’ devices that do not have it.

When PNG (or WebP) is the better choice

For a PNG header logo, export at 2× the display size (e.g. 400 × 120 for a 200 × 60 slot) and consider WebP for a smaller file. Our format test shows the size differences.

SVG security and WordPress

An SVG is code, and code can include JavaScript. A malicious SVG uploaded to a site can run scripts when opened directly. For that reason WordPress blocks SVG uploads by default, and many other platforms restrict them.

Safe ways to use an SVG logo on WordPress:

  1. Install a plugin that sanitises SVGs on upload (for example “Safe SVG”), and only allow trusted users to upload them.
  2. Or paste the SVG code directly into your theme’s header template or a custom HTML block — only for a file you trust.
  3. Or keep using a PNG/WebP logo in the theme’s logo setting and add the SVG only via code.

Never upload SVGs from unknown sources. If you received an SVG from a third party, open it in a text editor and check for <script> tags or on…= attributes. You can also clean editor metadata and comments with the SVG Metadata Remover, which keeps the paths untouched.

Performance: making the header logo fast and stable

The header logo often appears in the first screen, so it can affect Core Web Vitals:

<a href="/" class="site-logo">
  <img src="/images/logo.svg" width="200" height="60" alt="Brightside Bakery home">
</a>

For a PNG with retina support, use srcset:

<img src="/images/logo-200.png" srcset="/images/logo-400.png 2x" width="200" height="60" alt="Brightside Bakery home">

Dark mode with SVG

If the SVG is inlined in the HTML and its shapes use fill="currentColor", the logo takes the text colour of its container — switch the text colour for dark mode and the logo follows. For an external SVG file, a <picture> element can swap files:

<picture>
  <source srcset="/images/logo-white.svg" media="(prefers-color-scheme: dark)">
  <img src="/images/logo.svg" width="200" height="60" alt="Brightside Bakery home">
</picture>

Our website header logo guide covers sizing for desktop and mobile headers in detail.

Alt text for logos

When the logo links to the homepage, the alt text should describe the link destination, e.g. alt="Brightside Bakery home". When it is purely decorative next to the company name in text, use alt="". Never stuff keywords into logo alt text.

Frequently asked questions

Is SVG or PNG better for a website logo?

SVG, if you have a true vector logo. It is sharp at every size, very small and can adapt to dark mode. Use PNG or WebP at 2× display size for photographic or complex logos, or when SVG is not allowed.

Why can’t I upload an SVG to WordPress?

WordPress blocks SVG uploads by default because SVG files can contain scripts. Use a plugin that sanitises SVGs or add the logo through code.

How do I know if my SVG logo is a real vector?

Open it in a text editor. A real vector contains path elements; a fake one contains an embedded base64 PNG image. Zooming to 400% should also stay perfectly sharp.

What size should a PNG website logo be?

Twice the size it is displayed at — for example 400 × 120 px for a logo shown at 200 × 60 — so it stays sharp on high-density screens.

Should I lazy-load my logo?

No. The header logo is visible immediately; lazy-loading delays it. Set width and height and load it normally.

Tools used in this guide

All tools run in your browser; your image files are not uploaded to our server.

Keep reading

Sources checked for this guide

Platform upload rules change. We re-check the sources above when we update a guide; if you spot something out of date, send a correction.

From the team behind these free tools

Your logo is sorted. Is your website bringing in clients?

These tools are built by Webteqno, a web design and SEO studio with 9+ years and 200+ websites behind it. We help US small businesses look credible and get found on Google and in AI search.

Serving small businesses, service firms and SBA-certified federal contractors across the US.