Sustainable Web Design: How Green Coding Makes Your Website Faster, Cheaper and More Sustainable

Web Development 7 min read Sidora AG
All articles
Sustainable Web Design: How Green Coding Makes Your Website Faster, Cheaper and More Sustainable

Every website visit consumes energy: in data centres, across networks and on end devices. Scaled up to all page views, this adds up to a measurable CO2 footprint. The good news: sustainable web design is not about doing without. Most measures make a website faster and cheaper to run at the same time.

The W3C Web Sustainability Guidelines (WSG)

The Web Sustainability Guidelines (WSG) provide a comprehensive catalogue for sustainable digital products. They are organised into four areas: user experience design, web development, hosting and infrastructure, and business strategy and product management.

It is important to understand their status: the WSG are not a binding standard. They originated in a W3C Community Group and, since 2025, have been maintained by the W3C Sustainable Web Interest Group. They are published as a "Group Note Draft", with the latest version dated 16 October 2026. According to the W3C, such a draft is not endorsed by the W3C or its members, and the document deliberately no longer carries a version number such as "2.0", because it is maintained as a living document.

The WSG are still a useful reference because they are specific. A few examples:

  • Disable autoplay for audio, video and other media by default.
  • Resize, optimise and compress media for different screen sizes, devices and user needs.
  • Identify and remove unused code, especially CSS and JavaScript.
  • Favour providers that disclose their environmental policies publicly and transparently, and use electricity with the lowest possible carbon intensity.

How to Estimate a Website's Footprint

A widely used method is the Sustainable Web Design Model, currently in version 4. It converts the volume of data transferred into energy, split across data centres, networks and user devices, and multiplies the result by the carbon intensity of the electricity. By default it uses the global average of 494 g CO2e per kilowatt hour; regional values can be substituted. In this model, user devices account for 54 per cent of energy use, networks for 24 per cent and data centres for 22 per cent. It also takes into account green hosting, the share of returning visitors and the share of cached data.

The authors themselves state that models and estimates are imprecise by nature and that their model is likely to overestimate actual emissions. It is therefore of limited use for a precise carbon footprint, but very useful for comparisons: before and after an optimisation, page A versus page B, your own site versus a competitor's.

For context: using version 4 of the model, the HTTP Archive Web Almanac 2024 calculated a median of 0.37 g of CO2 per page view on desktop and 0.33 g on mobile for the websites it measured. The main driver is page weight, and it keeps growing. According to the Web Almanac 2025, the median home page in July 2025 weighed 2.86 MB on desktop and 2.56 MB on mobile. On mobile, 911 KB of that was images, 632 KB JavaScript, 122 KB fonts and 77 KB CSS. Between 2015 and 2025, the median mobile home page grew by around 203 per cent.

Practical Green Coding Measures

Asset optimisation: Images are the biggest item. Use modern formats such as AVIF and WebP with a JPEG fallback, serve appropriate sizes via srcset and compress images automatically in the build process. There is plenty of room for improvement: according to the Web Almanac 2024, WebP accounted for only around 12 per cent of all images and AVIF for about 1 per cent. Avoid autoplay videos. The Web Almanac observes a trend in the wrong direction here: the share of websites explicitly not using autoplay fell from 53 to 45 per cent.

Code hygiene: Remove unused CSS and JavaScript. For the 10 per cent of websites carrying the most dead weight, the Web Almanac 2024 found more than 200 KB of unused CSS and, on mobile, more than 800 KB of unused JavaScript. Typical culprits are themes built for every conceivable use case, plugins that load their files on every page, and tracking and marketing scripts. The browser's developer tools show which code is actually used on a page, and build tools can strip out unused CSS rules automatically.

DOM and processing load: Deeply nested HTML structures, like those produced by some page builders, increase the work required for style and layout calculations, especially during interactions and dynamic changes. Flatter structures and sparing use of animation reduce the load on the processors of user devices, which account for the largest share of energy use in the model.

Caching and fonts: Set long cache lifetimes for versioned files so that returning visitors do not download them again. Load only the font weights you actually use, and host them yourself.

Green hosting: Choose a provider that documents its environmental policy publicly and verifiably. According to the Web Almanac 2024, only a small share of the websites measured, between 10 and 14 per cent depending on the analysis, run on providers listed as green in the Green Web Foundation's dataset. Ask your Swiss hosting provider specifically about its electricity supply, guarantees of origin and data centre efficiency. If you estimate your website's emissions, these details allow you to use regional values in the model instead of the global average.

Five Steps to a Lighter Website

  1. Measure the baseline: record page weight and number of requests for your most visited pages.
  2. Optimise images and videos: formats, sizes, lazy loading, no autoplay.
  3. Clear out scripts: review unused plugins, duplicate tracking tags and chat or social media widgets, and load only what is needed.
  4. Caching and fonts: set cache headers and reduce the number of font weights.
  5. Set a budget: an upper limit for page weight per page type, checked with every release.

Regulatory Pressure: What Applies and What Doesn't

The EU Corporate Sustainability Reporting Directive (CSRD) requires large and listed companies to publish regular sustainability reports in line with the European Sustainability Reporting Standards (ESRS). The first companies reported in 2025 on the 2024 financial year. The current trend, however, is towards relief: in April 2025, Parliament and Council agreed to postpone the start for the second and third waves of companies. The Commission proposed applying the CSRD only to the largest companies with more than 1,000 employees, and in December 2025 a political agreement was reached on the Omnibus I simplification package. For smaller companies that receive data requests from reporting customers as part of the value chain, the Commission adopted a standard for voluntary use in July 2026.

Whether your company is directly affected depends on its size and its EU business. For many Swiss SMEs, the topic is more likely to become relevant indirectly, when large customers request sustainability information from their suppliers. In Germany, the Blue Angel for resources and energy-efficient software products (DE-UZ 215) already provides an ecolabel for software. Among other things, it rewards efficient use of hardware, transparency about energy and hardware use, and freedom from advertising and tracking.

The Business Case

Sustainable web design pays off even without regulation. Less data means shorter loading times, particularly on mobile connections, and therefore a better starting point for good Core Web Vitals. Less data transfer and less processing also reduce hosting and bandwidth costs. And a lean codebase is easier to develop further later on, for example towards a server-first architecture that sends less JavaScript to the browser.

The most effective lever is rarely a single technique but discipline: a fixed page weight budget, clear ownership of new scripts and a quick check with every release. This protects against the gradual growth that the Web Almanac has documented for years.

Sidora AG takes page weight, caching and hosting into account from the concept stage onwards in website development. For existing websites, our digital consulting shows which measures will have the greatest impact.

Sources

Share this article

About Sidora AG

This article was written by Sidora AG, an owner-led digital agency from Winterthur. Since 2003 we have been designing and developing websites, online shops and custom solutions for companies across Switzerland — clearly explained and close to practice. Learn more about us on our agency page, and get an overview of our work under services.