★ Black Friday★ Cyber MondayWeb hosting up to 85% off, checked on each host’s own siteGrab the deals →

How to Display a Sharp Logo on Retina and 4K Screens with Srcset

Share

Does your logo look blurry or pixelated on an iPhone, iPad, MacBook or 4K monitor, while big brands’ logos look crisp? The reason is pixel density. High-resolution “retina” screens pack two or three device pixels into every CSS pixel, so a logo made at normal size gets stretched. The fix is simple: display a sharp logo on HD and 4K screens with the srcset attribute, or use an SVG logo. Here’s how we fixed ours.

Display a sharp logo on retina and 4K screens with srcset

Quick answer: Save your logo at double size (for example 400×60 for a 200×60 display size) and add it with srcset: <img src="logo.png" srcset="logo@2x.png 2x" width="200" height="30" alt="Site name">. Retina screens load the 2x file, others load the normal one. Even better, use an SVG logo, which is sharp at every size.

Why logos look blurry on retina screens

I took this iPad screenshot to show how blurry our old logo looked:

Blurry logo on a retina screen

And this is the same logo after the fix:

Sharp logo on a retina screen with srcset

Most logos look fine on an ordinary laptop screen and blurry on retina devices. A logo shown 200 pixels wide on a 2x screen actually covers 400 device pixels. If the image file is only 200 pixels wide, the browser has to upscale it, and it goes soft. Today nearly all phones, tablets and many laptops have 2x or 3x screens, so this affects most of your visitors.

How to display a sharp logo with srcset

Step 1: Create a 2x version of your logo

Suppose your logo displays at 200 × 30 pixels. Export it at that size as logo.png, and again at double the size, 400 × 60 pixels, as logo@2x.png. For phones with 3x screens, you can also add a logo@3x.png at 600 × 90.

Step 2: Add the srcset attribute

Your original logo code looks like this:

<img src="/logo.png" width="200" height="30" alt="QuickOnlineTips">

Add srcset with the larger files:

<img src="/logo.png"
     srcset="/logo@2x.png 2x, /logo@3x.png 3x"
     width="200" height="30" alt="QuickOnlineTips">

The browser checks the screen’s pixel density and downloads only the file it needs. Ordinary screens get the small src image, retina screens get the 2x file, and the width and height keep it displayed at 200 × 30. Older browsers simply ignore srcset and use src. See MDN’s guide to the img srcset attribute (external site, opens in new tab).

Keep the width and height attributes. They let the browser reserve space for the logo before it loads, which prevents layout shift (part of Core Web Vitals).

Even better: use an SVG logo

An SVG logo is a vector file, so it’s perfectly sharp on every screen at any size, with just one small file and no srcset needed:

<img src="/logo.svg" width="200" height="30" alt="QuickOnlineTips">

If your designer can export your logo as SVG, use it. Run it through an optimizer like SVGOMG (external site, opens in new tab) to make it even smaller. Stick with PNG or WebP only for logos with photographic detail.

Sharp logos in WordPress

  • Upload a larger logo: in Appearance > Customize > Site Identity, upload your logo at 2x its display size. WordPress automatically adds a srcset with the generated sizes, and your theme displays it at the right size.
  • Retina logo option: many themes, including Kadence and Astra, have a separate “retina logo” setting where you upload the 2x file.
  • SVG uploads: WordPress blocks SVG uploads by default for security. Use a plugin such as Safe SVG (external site, opens in new tab), which sanitises SVG files, if you want an SVG logo.

Use srcset for other images too

The same technique makes all your images responsive. WordPress adds srcset to images in posts automatically. Combine it with lazy loading for images further down the page; here’s how to lazy load images. Just don’t lazy load your logo or main image at the top, as that slows down the first view.

Frequently asked questions

Does a 2x logo slow down my site?

Slightly, for retina screens only, because they download the larger file. Logos are small, so the difference is tiny. An SVG logo is often smaller than a PNG.

Should I use x or w descriptors in srcset?

Use x descriptors (1x, 2x) for fixed-size images like logos. Use w descriptors with sizes for images that change width with the layout, such as article photos.

Why is my logo still blurry after adding srcset?

Clear your browser and site caches, and check the 2x file really is twice the size. Also check your CSS isn’t stretching the logo larger than its width attribute.

Found this useful? Share it with someone who needs it.

Subscribe to our weekly tech newsletter

New tech guides, free tools and 2-minute fixes, once a week.

🎁 100 Tech Terms ebook comes free with every subscription.

Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

12 Comments

  1. I often design the logos for my clients i have tool but sometimes it takes too much time. This is better tool thanks for sharing..

  2. yes i agree with above comments and i also saw that logo looks like blur :)
    we want next update from you

  3. I am using one software, but when we save image logo after adding effect, it get blur. Thanks for this tool, now logos are clear. Thanks for the psot

  4. great!! creating logo is not so easy. I’m going to create a logo every week.
    Pease look at my logo.

  5. Really this image attribute is awesome, I never heard about it. Now I used it. Its great. Thanks.

  6. Creating a logo is really easy with available tools these days. I found onlinelogomaker and awesome online tool and I ahve created few logos for my websites as well.

  7. I too face the same problem while uploading my logos on my website. This blog helps me a lot in fixing my problems. Thanks a lot for sharing this info.

  8. Its nice. But I want to know how can I make my looks attractive when it gets opened at any device.

  9. Wow.. Nice Tip Bro. Never knew anything like that before. Going to implement on my blogs and sites.