Calculate and Optimize

Web Page Carbon Footprint

A carbon emission calculator that takes into account the power consumption of device and server during browsing a web page.

See the paper

il3
action trees

How It Works?

This calculator allows you to continuously analyze your web page in 4 steps.

icon1

Prompt

Enter the URL, estimate monthly pageviews and first/returning visit ratio of the web page you want to analyze and click the ‘Calculate’ button.

icon1

Calculate

The calculator fetches the data from the entered URL, applies various audits, calculates the page load size and calculates the energy consumption depending on the server location of the web page served.

icon1

Report

The calculator tool then generates a report that includes the carbon footprint in terms of kg CO2, the amount of trees needed to offset the carbon footprint, and a list of recommendations to optimize the web page using Google Lighthouse metrics.

icon1

Optimize

You can then take action and apply the recommended changes and optimizations to reduce the carbon footprint of the web page using the given documentation links.

il1

Open Source

This complete project is open source and licensed under MIT License. Feel free to make contributions, send pull requests or fork the current project.

github See on GitHubil1

Details and Metrics

The calculator reports are based on various metrics, see details of these processes and the assumptions we made while designing this tool.

The user inputs their domain name into the calculator and the web application will generate a report on the carbon emission of the website depending on the data transfer size and website efficiency. The report will include a set of recommendations on how to reduce the carbon footprint of the website.This calculator will also tell you the amount of trees you should plant to offset your website's carbon footprint.

For more details, see the academic paper.

Depending on data from CarbonFund taking the average CO2 per kilowatt hour of 0.371 kg per kWh (this value will be changed depending on the country of origin of the users and servers)

Depending on the research by ENCON EU,

In summary, it can be concluded that the annual CO2 offsetting rate varies from 21.77 kg CO2/tree to 31.5 kg CO2/tree. To compensate for 1 tonne of CO2, 31 to 46 trees are needed. In Europe, there are 300 to 500 trees per hectare. For calculating the figures on the Encon website, we assume a rate of 24 kg CO2/tree and an average of 500 trees per hectare. This means that 1 hectare of forest: 500 trees x 24 kg CO2/tree = 12,000 kg of CO2 offsets, i.e. 12 tonnes CO2/hectare.

As an average, this application will assume one tree annual CO2 offsetting rate as 24 kg.

Carbon emission per kb downloaded;

In a 2021 published visual calculation notebook by Chris Adams with energy consumption numbers taken from Shift Project's Lean ICT report concludes that downloading 1 mb of data on average emits 0.866 g of CO2. Note that this number is only the transfer of data between servers, CDNs and user devices, and does not include the user device’s energy consumption to consume this data in terms of consuming content and scrolling through a website.

Since our calculations will be in kb, we will accept the kB data transfer as 0.866/1024 = 0.000845703125 g CO2 per kb.

Carbon emission during Web browsing per minute;

Depending on a paper called An Analysis of Power Consumption in a Smartphone in the section about Web Browsing;

Web browsing average power over WiFi and GPRS. Aggregate power consumption is 352.8 mW for WiFi, and 429.0 mW for GPRS, excluding backlight 410.2 mW. The benchmark was trace-based, and ran for a total of 490 seconds.

If we accept that half of users will use WiFi and other half celular, in total an average smart device would consume ((352.8 + 429.0) / 2 + 410.2) / (490/60) = 98.1 mW of energy per minute.

Since most of the energy consumption happens during the page load and idle browsing of a website does not consume as significant of an energy as data transfer energy consumption. We will accept the average session duration as one minute and won’t give an option to the user of the tool to change it. 98.1 mW of energy per page load on a device.

In conclusion, 0.371 * (98.1 / 1000000) = 0.002183706 g CO2 emitted per page load and browse.

For more details, see the academic paper.

The following is a list of some of the recommendations that the calculator offers.

• Optimize the total blocking time (TBT) of the web page by reducing the number of JavaScript and CSS files, and optimizing the size of these files.

• Reduce the amount of JavaScript code with minification and tree-shaking algorithms.

• Reduce the size of images used on the page.

• Optimize the largest contentful paint (LCP) of the web page by reducing the number of images and videos.

• Optimize the JavaScript execution time of the web page by reducing the size of the JavaScript code.

• Optimize the speed index (SI) of the web page by reducing the amount of JavaScript and CSS code.

• Reduce the cumulative layout shift (CLS) of the web page by optimizing the size of images and videos.

• Optimize the initial server response time of the web page by optimizing the server configuration.

• Implement lazy image loading on the web page to reduce the amount of data transferred.

• Implement text compression to reduce the amount of data transferred.

• Optimize the DOM size of the web page by optimizing the size of HTML, CSS, and JavaScript code.

• Avoid using document.write on the web page.

For more details, see the academic paper.

Do you have feedback?

This project is still in beta stage. You can give feedback and detail your problems by creating a new issue in this Github repository.