All articles
astrosveltekitreactvueangular

"The Carbon Footprint of JavaScript Frameworks: Our 2026 Data"

·5 min read·"Team"

Astro emits 0.005g CO₂ per page. SvelteKit ranges 0.016g-0.089g. React-based sites are typically 0.015g-0.025g. For a site with 100 million monthly page views, framework choice determines whether you emit 500kg or 2300kg of CO₂ per month. Environmental impact should be part of your framework decision.

Introduction

We talk about performance metrics: bundle size, Core Web Vitals, time to interactive. These are user-centric. But there’s another metric that’s rarely discussed: the carbon footprint of each framework.

Every byte of JavaScript transmitted, every millisecond of computation, every server request uses energy. Energy comes from power grids. Power grids burn fossil fuels. Carbon dioxide gets released.

This isn’t theoretical. It’s measurable, scalable, and something developers should consider.

We used the Sustainable Web Design model to calculate the carbon emissions of frameworks in our benchmark. The results surprised us.

The Benchmark Data

We measured CO₂ emissions for identical functionality implemented in each framework:

Framework Bundle (KB) Energy/page (kWh) CO₂/page Basis
Astro 58 0.00001 0.005g Our test site
SvelteKit (optimized) 179 0.000030 0.016g Firebase variant
SvelteKit (typical) 309 0.000051 0.027g Cloudflare variant
SvelteKit (heavy) 1008 0.000165 0.089g Full-featured variant
React (typical) 227 0.000035 0.019g Standard SPA bundle
Vue (typical) 89 0.000016 0.009g Optimized SPA
Angular 450 0.000087 0.047g Typical configuration
Next.js (optimized) 215 0.000033 0.018g With code splitting
Nuxt (typical) 185 0.000028 0.015g SSR optimized

The Sustainable Web Design Model

Carbon emissions on the web are calculated using this formula:

CO₂ per page = (data transferred in bytes / 1000) × energy intensity × carbon intensity

Where:

  • Data transferred: Bundle size + assets downloaded
  • Energy intensity: How much electricity is consumed per byte transmitted
  • Carbon intensity: How much CO₂ is emitted per kWh of electricity

The Sustainable Web Design model (published by the Green Web Foundation) estimates:

  • Energy intensity: 0.81 kWh per GB of data transferred
  • Carbon intensity: 442 grams of CO₂ per kWh (global average; varies by region)

This accounts for:

  • Server computation
  • Data transmission over networks
  • Device processing
  • Amortized hardware manufacturing

It’s not a perfect model, but it’s the best consensus we have.

What This Means in Practice

Let’s scale the numbers:

For a single-page site (10K monthly visitors)

  • Astro: 50g CO₂/month (equivalent to 0.2 km driven by car)
  • Angular: 470g CO₂/month (equivalent to 1.9 km driven)
  • Difference: 420g CO₂ ≈ 1.7 km worth of driving

Barely noticeable at this scale.

For a medium site (1M monthly visitors)

  • Astro: 5kg CO₂/month
  • Vue: 9kg CO₂/month
  • React: 19kg CO₂/month
  • Angular: 47kg CO₂/month
  • Difference (Astro vs. Angular): 42kg CO₂/month = 170 km of car driving

For a large site (100M monthly visitors)

  • Astro: 500kg CO₂/month (6 metric tons/year)
  • Vue: 900kg CO₂/month (10.8 metric tons/year)
  • React: 1900kg CO₂/month (22.8 metric tons/year)
  • Angular: 4700kg CO₂/month (56.4 metric tons/year)

Choosing Astro over Angular: 4.2 metric tons of CO₂ saved per month.

To put this in perspective:

  • A cross-country flight (NYC to LA) for one person: ~1 metric ton CO₂
  • Average annual car driving (12,000 miles): ~5 metric tons CO₂
  • Monthly difference between Astro and Angular at 100M scale: equivalent to 5-6 transcontinental flights per month

Why Framework Choice Matters

The differences come down to bundle size, execution time, and configuration:

Astro: 0.005g (99th percentile)

  • Static HTML by default (0 JS executed per page)
  • Only island components hydrate
  • Minimal energy per page view
  • Scales extremely well

SvelteKit: 0.016g-0.089g

  • Compiler produces lean output (~7KB for same functionality as React)
  • Hydration cost is lower than React
  • Configuration dramatically impacts final bundle
  • Can be optimized to near-Astro levels or balloon to Angular scale

React: 0.019g

  • Large baseline bundle
  • Hydration required on every page
  • Consistent energy cost regardless of page complexity
  • Limited ability to reduce below this without architectural changes

Vue: 0.009g

  • Moderate bundle size
  • Good performance in hydration
  • Better than React, not as efficient as Astro or optimized SvelteKit

Angular: 0.047g (worst in our benchmark)

  • Large framework overhead
  • TypeScript compilation cost
  • RxJS adds weight
  • Substantial initialization code required

The Multiplier Effect

Here’s the crucial insight: carbon emissions scale linearly with traffic.

A small optimization (20KB bundle reduction) seems trivial on one page view. But:

  • At 1M page views/month: 20KB × 1M = 20GB extra bandwidth = 8.8kg CO₂/month
  • At 100M page views/month: 20GB × 100 = 2000GB extra bandwidth = 880kg CO₂/month

Choosing a heavier framework is essentially choosing to emit more carbon at scale. If your site is small, it doesn’t matter. But if you’re building something that might grow, the choice today has compound impact.

Real-World Examples

News site with 500M monthly page views:

Using React (0.019g CO₂/page):

  • 500M × 0.019g = 9500kg CO₂/month (114 metric tons/year)

Using Astro (0.005g CO₂/page):

  • 500M × 0.005g = 2500kg CO₂/month (30 metric tons/year)

Difference: 84 metric tons of CO₂ per year — equivalent to one person flying transatlantic 42 times.

SaaS product with 10M monthly page views:

Using SvelteKit optimized (0.016g CO₂/page):

  • 10M × 0.016g = 160kg CO₂/month (1.92 metric tons/year)

Using SvelteKit heavy config (0.089g CO₂/page):

  • 10M × 0.089g = 890kg CO₂/month (10.68 metric tons/year)

Difference: 8.76 metric tons CO₂ per year — equivalent to one person driving 1500 miles.

Regional Variations

Carbon intensity varies by region. We used the global average (442g CO₂/kWh), but:

  • Coal-heavy grid (Poland, China): ~800g CO₂/kWh
  • Natural gas grid (US average): ~450g CO₂/kWh
  • Nuclear/hydro (France, Canada): ~50-100g CO₂/kWh

If your servers are in a coal-heavy region, emissions are 8x higher. If you’re in a carbon-friendly region, they’re dramatically lower.

The framework choice matters more in coal-heavy regions, less in clean regions. But the direction is the same everywhere.

The Business Argument

Beyond environmental ethics, there’s a business case:

  1. Sustainability marketing: Consumers increasingly care. “Built with Astro” is a selling point.
  2. Reduced hosting costs: Smaller bundles mean less bandwidth, less server compute = lower bills.
  3. Better user experience: Faster pages mean better engagement and conversion.
  4. Regulatory risk: Carbon taxes and sustainability regulations are coming. Being ahead is prudent.

Framework choice is a lever for all four.

Our Recommendation

Environmental impact should be part of your framework decision. Not the only factor, but a legitimate consideration.

If you care about sustainability:

  1. Choose Astro for content sites. It’s 99th percentile in carbon efficiency. No trade-offs.
  2. Choose well-configured SvelteKit for interactive sites. It’s efficient by default, but configuration matters enormously.
  3. Avoid Angular unless it’s specifically required. It’s ~10x heavier than Astro per page view.
  4. Minimize dependencies ruthlessly. Every 20KB of JavaScript is ~9kg CO₂ per 100M page views.

If you’re using React or Vue:

  • Acknowledge the environmental cost of your choice
  • Optimize relentlessly (code splitting, lazy loading, bundle analysis)
  • Use server-side rendering where possible
  • Monitor carbon emissions as part of your build pipeline

Don’t be dogmatic about this. React’s larger footprint is worth it for certain applications. A dynamic SaaS tool using React at 10M monthly views emits 190kg CO₂/month. That’s real, but it’s not an environmental catastrophe if the tool is genuinely valuable.

But for static sites, blogs, documentation, and content platforms — there’s no excuse not to choose Astro. The environmental case is airtight.

Carbon Monitoring Tools

If you want to track your site’s carbon footprint:

  • Website Carbon Calculator: websitecarbon.com (estimates based on Sustainable Web Design)
  • GreenFrame.io: Measures real hardware emissions (more accurate but premium)
  • Carbon.css: Integrates carbon tracking into your build pipeline
  • Ecograder: Full sustainability audit with recommendations

We recommend checking your site’s carbon footprint quarterly. It’s as important as performance monitoring.


Want to choose a framework with both performance and environmental impact in mind? Our quiz weights all the factors — including carbon footprint — to recommend your best match. Take the quiz.

Related articles