Logo in a Website Header: SVG Files, Size and Speed
A plumbing company in Tyler called me because their new site felt slow on phones. The build was clean, the hosting was fine, and the homepage was pulling a 1.4 megabyte PNG of their logo that displayed at 164 pixels wide.

A plumbing company in Tyler called me because their new site felt slow on phones. The build was clean, the hosting was fine, and the homepage was pulling a 1.4 megabyte PNG of their logo that displayed at 164 pixels wide. Their designer had delivered a 3000 pixel file for print and the developer had put it in the header, which is the single most common performance mistake I see on small business sites.
Nobody involved did anything unreasonable. The designer supplied the biggest file so it would be useful everywhere. The developer used the file he was given. The header slot is just a place where a logo stops being artwork and becomes a technical object with a size, a format, a loading priority and an accessible name, and almost nothing in a normal brand handoff tells you what those should be.
Start with the space it has to fill
Measure the slot before you pick a file. On the sites I build, a desktop header logo occupies something between 140 and 220 pixels wide, and the header band itself is usually 64 to 88 pixels tall. On mobile that logo drops to 110 to 150 pixels wide inside a band of 56 to 64 pixels.
From those numbers everything else follows. A raster file needs to be twice the largest display width to look right on a high density screen, so a logo shown at 180 by 48 wants a file around 360 by 96. Not 3000 by 800. Exported at that size as a PNG with a transparent background, most wordmarks land between 6 and 14 kilobytes.
The reason this matters more than it sounds: on a simple service page with no hero image, the header logo is frequently the largest contentful element on the screen, which makes it the thing the browser is scored on for perceived load speed. A 1.4 megabyte logo is not a cosmetic problem. It is the page. I went into how that chain of events produces a site that feels sluggish on a fast connection in why your website feels slow even on a fast connection.
SVG, and the four ways it goes wrong
A well drawn vector logo is the right answer most of the time. It stays crisp at any screen density, it scales to the sticky header version without a second file, and a clean wordmark exports to between 2 and 6 kilobytes. I have one client whose entire logo is 2.1 kilobytes, which is smaller than this paragraph as a JPEG.
Four things break it, and I check all four on every delivery.
Live text. If the type in the file was never converted to outlines, the SVG references a font by name, and a browser without that font substitutes something else. Your logo renders in Arial on half the machines that visit. Ask for outlined paths and confirm by opening the file in a text editor and searching for a text element.
A missing viewBox. Without it the graphic has no intrinsic aspect ratio to scale against, and you get a logo that refuses to resize or that renders at some arbitrary size. This is the fix for roughly a third of the broken SVGs I am handed.
Embedded raster data. Some export paths wrap a PNG inside an SVG wrapper, which gives you all the size of the bitmap and none of the benefit of the vector. If the file is 300 kilobytes, this is almost always why.
Auto traced spaghetti. A logo converted from a scan can carry eight thousand nodes describing an edge that needed forty. The file is large, and worse, the browser has to render all of it on every paint. Run it through an optimiser and have the designer redraw anything that will not come down.
The markup that actually ships
Here is the checklist I run before a header goes live, in the order I check it.
- Width and height attributes set on the image element, matching the aspect ratio of the file. Without them the browser does not know how much room to reserve and the header jumps once the logo arrives, which is a visible flinch on a slow connection.
- Alt text that reads as the business name, not the word logo. If the logo links to the homepage, that alt text becomes the accessible name of the link, so "Dawson Plumbing" is correct and "Dawson Plumbing logo home page link" is noise read aloud on every page.
- Eager loading and high fetch priority. The header logo is above the fold on every page of the site. Lazy loading it is a mistake that costs you the one metric you were trying to improve.
- An image element rather than a CSS background. Backgrounds cannot carry alt text, do not get discovered early by the preload scanner, and disappear in high contrast modes.
- The link wrapped around it points at the site root, and on the homepage itself it still links to the root rather than being removed. People click it anyway.
- One heading rule: the logo lives inside a heading element only on the homepage, if at all. A logo inside a first level heading on all eighty pages of a site gives every page the same headline.
- A second file for the inverted version, if your header turns dark when it sticks. An inverted logo needs to be drawn, not recoloured, and an inverted mark needs thinner strokes rather than a colour swap.
That is seven checks and takes about four minutes. I keep them in the same spreadsheet where I track contact forms, because both are the kind of small thing that quietly decides whether a site works.
The rule I would qualify
Always use SVG for a logo on the web. You will read that everywhere, I have said it myself in client meetings, and it is right often enough to be a reasonable default. It is not a law, and I have the numbers from my own work to say so.
Across the last sixty or so sites I have shipped, roughly one in six logos was genuinely better off as a raster file in the header. The cases cluster. Marks with soft gradients or a mesh fill produce enormous SVGs because the gradient has to be described mathematically. Logos with a photographic or textured element inside them are raster whether you like it or not. Illustrative marks, the kind with a detailed animal or a landscape, carry node counts that make the browser work on every scroll on a cheap phone.
My test is unglamorous: export both, at the real display size for the PNG, optimise both, and compare the file sizes and the paint behaviour on an actual mid range Android phone rather than a desktop simulation. If the SVG is not smaller and not visibly crisper, ship the PNG. One client's crest logo came out at 214 kilobytes as a vector and 11 kilobytes as a double density PNG, and nobody has ever noticed the difference on screen.
What I will not compromise on is the favicon, which has to be drawn separately regardless of what the header uses, for reasons we covered in how to test a logo at favicon size.
Where it breaks on real sites
The sticky header is the usual culprit. A logo that reads well at 180 pixels in an 80 pixel band gets squeezed into a 56 pixel band on scroll, and a wordmark with a descender or a tagline underneath becomes unreadable. The fix is a simplified version swapped in by the stylesheet at that breakpoint, which is the practical use for the family of versions in responsive logo design and the versions you need.
Mobile headers break for a different reason. A hamburger button, a phone icon and a logo competing for a 360 pixel wide row leaves the logo about 140 pixels, and most horizontal lockups do not survive that. This is where a stacked or a mark only version earns its keep.
Print is the forgotten one. A header logo in white, on a dark band, prints as nothing on white paper, and small business sites get printed more than anyone expects: quotes, service pages, directions. A print stylesheet that swaps in the dark version costs one rule.
And the last one is the handoff itself. Ask for the header files by their display size, in writing, as part of the logo delivery rather than three weeks later when the site is being built. A designer who knows the logo will sit in a 72 pixel band at 180 pixels wide will draw a different file than one who assumes it is going on a van.
FAQ
What size should a website header logo be?
Decide the display size first, usually 140 to 220 pixels wide on desktop, then export a raster file at twice that. For SVG the dimensions do not matter as long as the viewBox is present, but the drawing should still be checked at the real size on a phone.
Should my header logo be SVG or PNG?
SVG by default, because it is smaller and sharper for most wordmarks and simple marks. Switch to a double density PNG when the logo has gradients, texture or heavy illustration, since those produce vector files that are larger and slower to paint.
What alt text should a logo have?
The business name on its own. Skip the word logo, skip the location, and skip any description of the artwork. Screen reader users hear that string on every page of the site, so short and factual wins.
Why does my header jump slightly when the page loads?
Almost always a logo with no width and height attributes, so the browser reserves no space for it until the file arrives. Set both to match the file's ratio and the jump disappears. The same cause is behind most layout shift on otherwise simple pages.
More in Logo Design
Logo Design
Dark Mode Logo Versions and Why Inverting Fails
On the second game I worked on, we put the publisher's logo on the title card and everyone in the room said the same thing...
Logo Design
Animated Logo Design and Where Motion Actually Helps
A bakery client paid 1,800 dollars for an animated logo two years ago.
Logo Design
Monogram Logo Design and When Initials Work for a Brand
Your business name is long, your designer keeps suggesting initials, and you are not sure whether two letters will mean...