Green Software Engineering: Writing Code That Uses Less Energy
Green software engineering is the practice of designing, writing, deploying and operating software in ways that reduce its environmental impact. At the code level, that can mean using more efficient algorithms, avoiding unnecessary computation, reducing data movement, shrinking web pages, caching reusable data, limiting background work and choosing architectures that need fewer computing resources. But modern green software goes beyond writing “faster” code. The Green Software Foundation's 2026 definition includes the software itself and the hardware it runs on, with attention to carbon emissions, energy consumption, water use and waste across the technology stack. The organization identifies energy efficiency, hardware efficiency and carbon awareness as the core ways software teams can reduce operational emissions, while its Software Carbon Intensity standard provides a method for measuring emissions per functional unit.
Summary
-
Topic: Green software engineering
-
Main goal: Reduce the environmental impact of software
-
Core idea: Make software perform useful work with less energy and fewer physical resources
-
Three major carbon-reduction actions: Energy efficiency, hardware efficiency and carbon awareness
-
Key measurement approach: Software Carbon Intensity (SCI)
-
Current international standard: ISO/IEC 21031:2024 for Software Carbon Intensity
-
Major practical resources: Green Software Patterns and Green Software Foundation learning materials
-
Main areas: Code, algorithms, architecture, cloud infrastructure, web applications, AI, data and operations
-
Important current development: In 2026, the Green Software Foundation broadened its definition to include carbon, energy, water and waste across the stack from silicon to screen
-
AI relevance: AI workloads have increased the importance of efficient models, inference, hardware use, scheduling and measurement
-
Current standards work: SCI for AI has progressed through publication and ISO-readiness work, while Software Water Intensity and other standards efforts are developing
-
Best principle for developers: Measure first, then optimize the parts of the system that actually consume significant resources
What Is Green Software Engineering?
Green software engineering is an approach to software development that considers environmental impact alongside traditional engineering goals such as performance, reliability, security, scalability and cost.
The basic idea is simple: software needs physical hardware to run, and that hardware consumes energy and has an environmental footprint.
Every web request, database query, background task, machine-learning inference or video stream eventually uses physical computing resources. Servers consume electricity. Networks move data. Devices process information. Data centers require cooling. Hardware has to be manufactured, transported and eventually replaced.
That means software design decisions can influence environmental impact.
The Green Software Foundation describes the discipline as an emerging field connecting software design with areas such as climate science, electricity markets, hardware and data-center design. Its educational framework identifies six important areas: carbon efficiency, energy efficiency, carbon awareness, hardware efficiency, measurement and climate commitments.
The definition is also becoming broader.
In June 2026, the Green Software Foundation described green software as software and the hardware it runs on that are designed, built and operated to minimize carbon emissions, energy consumption, water usage and waste across the technology stack.
That is important because a small piece of code is never completely isolated from the physical world.
Why Does Software Use Energy?
Software itself is not burning electricity. The machines running it are.
A simple application may use a combination of:
-
CPUs
-
GPUs
-
memory
-
storage
-
network equipment
-
cloud servers
-
mobile devices
-
desktop computers
-
data-center cooling systems
The more work a system performs, the more resources may be required. However, the relationship is not always as simple as “fewer lines of code equals less energy.”
A short program can be inefficient.
A larger application can sometimes perform a task efficiently because it uses good caching, an effective algorithm or a well-designed architecture.
This is why green software engineering is primarily about useful work per resource consumed, rather than simply making code shorter.
The Software Carbon Intensity specification treats software emissions as a combination of operational emissions and embodied emissions. Operational emissions are associated with electricity use, while embodied emissions account for the environmental impact associated with the hardware required by the software.
Energy Efficiency vs. Carbon Efficiency
These terms are closely related but are not identical.
Energy efficiency means using less electricity to perform the same useful task.
For example, suppose two applications complete the same operation, but one uses 10% less electricity. The more efficient application has lower energy consumption.
Carbon efficiency considers where and when that electricity is generated.
One kilowatt-hour of electricity can have different carbon consequences depending on the electricity system supplying it. Software that runs when the electricity grid has a lower marginal carbon intensity can have a lower carbon impact than the same workload running at a dirtier time.
The Green Software Foundation therefore separates energy efficiency from carbon awareness, which means adapting computation according to the carbon intensity of the electricity being consumed.
The Three Main Ways Software Can Reduce Carbon Emissions
The Green Software Foundation identifies three actions that cover software carbon reduction:
| Approach | What It Means | Example |
|---|---|---|
| Energy efficiency | Use less electricity for the same useful work | Reduce unnecessary CPU processing |
| Hardware efficiency | Use fewer physical resources | Run an application on fewer or better-utilized machines |
| Carbon awareness | Run workloads when or where electricity is cleaner | Shift flexible batch processing to lower-carbon periods |
These principles appear throughout the Foundation's training, standards and patterns. (Green Software Practitioner)
There is also a fourth concept that increasingly matters in modern green software: measurement.
You need to know what a system consumes before you can confidently determine whether an optimization actually helped.
Writing Code That Uses Less Energy
For ordinary developers, this is where green software becomes practical.
The goal is not to make every function obsessively optimized. The goal is to identify unnecessary work and eliminate it while preserving the required functionality, quality and user experience.
Use Efficient Algorithms
Algorithm choice can have a major effect on resource use.
An algorithm that needs far more operations as the input grows can consume substantially more computing resources than a better-performing alternative.
Consider a search operation.
Searching an unsorted collection one item at a time can require repeated comparisons. Using an appropriate data structure can make repeated lookups much more efficient.
This does not mean developers should automatically replace every simple loop with the theoretically fastest algorithm. Engineering involves trade-offs.
A more complicated algorithm may require:
-
More memory
-
More code
-
More development time
-
More maintenance
-
Greater complexity
The right choice is the most efficient solution that still meets the actual requirements of the system.
Avoid Unnecessary Computation
One of the simplest green coding principles is also one of the most powerful:
Do not make the computer do work that does not need to be done.
Examples include:
-
Recalculating values that have not changed
-
Performing duplicate database queries
-
Processing records that can be filtered earlier
-
Running background jobs more frequently than necessary
-
Repeatedly parsing the same data
-
Making network requests for information already available locally
Removing needless work can improve both energy use and application performance.
Cache Reusable Data
Caching is a particularly practical example.
The Green Software Patterns catalog recommends caching static data because serving information locally can reduce network traffic compared with repeatedly retrieving it remotely.
For example, imagine an application that repeatedly downloads the same configuration data.
Instead of requesting it every time:
-
Retrieve it once.
-
Store it temporarily.
-
Reuse the cached value.
-
Refresh it only when necessary.
That can reduce network operations and associated processing.
Caching is not always automatically greener, however. A poorly designed cache can create memory waste, stale data, invalidation problems or unnecessary storage activity.
The correct question is not simply “Can I cache this?” but “Will caching this reduce total resource consumption without creating larger costs elsewhere?”
Reduce Data Movement
Moving data takes resources.
A web page that downloads large files, unnecessary scripts, oversized images and excessive tracking data puts additional work on networks, servers and user devices.
The Green Software Patterns catalog includes development guidance such as avoiding excessive DOM size and reducing critical request chains because web processing and rendering create computational and network work.
That makes front-end engineering part of green software engineering.
A lightweight website can reduce work performed by:
-
The server
-
The network
-
The browser
-
The CPU
-
The GPU
-
The user's battery-powered device
Keep Web Pages Lightweight
Developers can reduce unnecessary browser work through techniques such as:
-
Removing unused JavaScript
-
Reducing unnecessary dependencies
-
Compressing appropriate assets
-
Serving properly sized images
-
Avoiding excessive animations
-
Limiting unnecessary third-party scripts
-
Reducing large DOM structures
-
Loading content only when it is needed
These changes often have another advantage: they improve page speed.
Green software and good performance engineering therefore overlap in many practical areas.
Avoid Excessive Background Activity
An application does not need to perform work simply because it can.
Examples of questionable background behavior include:
-
Polling an API every few seconds when updates are infrequent
-
Refreshing data that users rarely view
-
Running cleanup jobs more frequently than necessary
-
Keeping unused processes active
-
Continuously calculating values that could be triggered by events
Event-driven systems can often avoid idle work.
The current Green Software Patterns catalog specifically includes on-demand execution for AI and agent workloads as a way to avoid unnecessary idle compute.
Green Software and Databases
Database activity can become a significant source of unnecessary computation.
Developers can often improve efficiency by examining:
-
Query structure
-
Indexing
-
Data retrieval patterns
-
Duplicate queries
-
Large scans
-
Unnecessary columns
-
Over-fetching
-
Poorly designed joins
-
Excessive repeated requests
For example, asking a database for an entire record when an application needs only two fields creates unnecessary data processing and transfer.
The principle is straightforward:
Request and process only what you actually need.
At large scale, small inefficiencies repeated millions of times can become significant.
Green Software and Cloud Computing
Cloud computing does not automatically mean green computing.
Cloud providers can improve infrastructure efficiency through shared resources and large-scale operations, but the software running in the cloud still determines how much infrastructure is required.
Green cloud engineering can involve:
-
Right-sizing compute resources
-
Avoiding permanently oversized servers
-
Improving utilization
-
Scaling infrastructure according to demand
-
Turning off unused environments
-
Reducing unnecessary storage
-
Choosing efficient architectures
-
Moving flexible workloads to cleaner periods or locations
The Green Software Foundation's patterns include guidance for capacity management and resource lifecycle, while its Software Carbon Intensity framework provides a way to think about emissions from software systems rather than only individual infrastructure components.
Carbon-Aware Software
Energy efficiency asks:
How can I use less electricity?
Carbon awareness asks:
When and where should I use that electricity?
Suppose a machine-learning training job can finish at any point during a 24-hour period.
Running it immediately may not be the lowest-carbon choice.
A carbon-aware system could examine electricity conditions and schedule the flexible workload for a period with lower marginal carbon intensity.
The Green Software Foundation describes demand shifting as moving computation to times or regions when electricity is less carbon intensive. Demand shaping instead changes how much computation is performed in response to electricity conditions.
The Foundation's Carbon Aware SDK emerged specifically to help developers integrate carbon-intensity data into applications. Its documented use cases include time-shifting and location-shifting workloads.
A UBS risk-modeling use case demonstrated enterprise-scale carbon-aware computing and reported the potential to avoid multiple metric tons of CO2 equivalent per year.
Carbon awareness is most appropriate for workloads that can tolerate some flexibility.
A medical emergency system or real-time safety-critical operation cannot simply wait for cleaner electricity.
A nightly analytics job, software build, batch simulation or some training workloads may have considerably more flexibility.
Hardware Efficiency Matters Too
Green software is not only about electricity.
The physical devices used to run software have environmental impacts from manufacturing, transportation, materials and eventual disposal.
Software that constantly demands newer hardware can increase those impacts.
A useful example is a mobile application that could run comfortably on older devices but receives updates that repeatedly increase memory and processing requirements.
Users may be pushed toward device replacement earlier than necessary.
The Green Software Foundation therefore includes hardware efficiency as a central green software competency and recommends designing for backwards compatibility where practical to help extend device lifetimes.
This produces an important engineering lesson:
A software upgrade is not environmentally neutral simply because it is delivered digitally.
Software Carbon Intensity
One of the most important developments in green software is the attempt to measure emissions consistently.
The Software Carbon Intensity (SCI) methodology provides a way of expressing software emissions as a rate associated with a functional unit.
The current SCI specification is an ISO-accredited standard, ISO/IEC 21031:2024.
The core expression is:
SCI = C / R
Where:
-
C is the carbon emissions caused by the software
-
R is the chosen functional unit
The methodology can be expanded to operational and embodied emissions:
SCI = (O + M) / R
Operational emissions can be expressed as energy multiplied by carbon intensity:
O = E × I
The specification defines E as energy consumed by the software system and I as location-based marginal carbon intensity. (GitHub)
The functional unit matters.
Depending on the application, it might be:
-
A user
-
An API call
-
A transaction
-
A device-minute
-
A machine-learning training run
-
Another meaningful unit of delivered functionality
This makes SCI different from simply saying, “Our server used 100 kWh.”
The more useful question is:
How much carbon was emitted for the useful work the software delivered?
How Developers Can Measure Software Impact
Measurement should be realistic.
Teams can start with:
-
CPU utilization
-
Memory utilization
-
GPU usage
-
Runtime
-
Number of requests
-
Data transferred
-
Storage use
-
Infrastructure utilization
-
Electricity consumption where measurable
-
Regional carbon-intensity data
The SCI methodology encourages teams to define a software boundary, select a functional unit, quantify energy and emissions, and report the calculation methodology transparently.
That transparency matters because measurements can otherwise become misleading.
Two applications cannot necessarily be compared fairly if one counts only server energy while the other includes network and end-user resources.
Major Green Software Concepts
| Concept | Main Question | Practical Example |
|---|---|---|
| Energy efficiency | Can the same work be done with less electricity? | Optimize an expensive computation |
| Carbon efficiency | Can the application emit less carbon for useful output? | Improve SCI per transaction |
| Carbon awareness | Can work happen when electricity is cleaner? | Shift batch processing |
| Hardware efficiency | Can fewer physical resources be used? | Increase server utilization |
| Measurement | How much does the system actually consume? | Track energy per transaction |
| Sustainable requirements | Does the feature need maximum resources? | Avoid unnecessary availability or performance targets |
| Lifecycle thinking | What happens before and after operation? | Extend device lifetimes and reduce replacement pressure |
These ideas reflect the Green Software Foundation's training, standards and pattern catalog. (Green Software Practitioner)
Green Software Patterns
One challenge in sustainability work has been that developers may understand the theory without knowing what to change inside a real codebase.
The Green Software Foundation created the Green Software Patterns catalog to address that problem.
The catalog contains practical patterns organized around stages such as:
-
Requirements
-
Architecture
-
Development
-
Operations
The development section currently includes patterns addressing areas such as DOM size, request chains, tracking, caching and other sources of unnecessary resource use.
The Foundation says its patterns are reviewed and curated, and each pattern explains its problem, proposed solution, expected SCI impact, assumptions and considerations.
This is important because sustainable engineering needs to move from general advice to repeatable engineering practice.
Practical Green Coding Techniques
| Coding Area | Less Efficient Approach | More Sustainable Approach |
|---|---|---|
| Data access | Repeatedly request unchanged data | Cache data where appropriate |
| Database | Retrieve entire records unnecessarily | Select only needed fields |
| Computation | Recalculate identical results | Reuse results when safe |
| Web | Load every resource immediately | Lazy-load noncritical content |
| Front end | Excessive DOM and scripts | Keep rendering work focused |
| APIs | Poll continuously | Prefer event-driven updates where appropriate |
| Background jobs | Run regardless of demand | Trigger work when needed |
| Images | Serve oversized files | Serve appropriately sized assets |
| Cloud | Permanently overprovision | Match resources to actual demand |
| AI | Use a large model for every task | Match model size to the task |
| Batch jobs | Run at arbitrary times | Consider carbon-aware scheduling |
| Hardware | Require frequent upgrades | Maintain compatibility with older devices |
The important point is that not every technique should be applied blindly. A green optimization should be measured against the application's real requirements, architecture and workload.
Green Software and Artificial Intelligence
AI has made green software engineering more important.
Modern AI systems can require significant computing resources for:
-
Model training
-
Fine-tuning
-
Inference
-
Data processing
-
Storage
-
Networking
-
Agentic workflows
The Green Software Foundation has expanded SCI into SCI for AI, designed specifically to measure the carbon emissions associated with artificial-intelligence systems. Current Foundation materials show the project progressing through publication and ISO-related work during 2026.
The Foundation also publishes AI-specific green software patterns.
Examples include selecting more energy-efficient AI/ML frameworks and using on-demand execution for AI and agent workloads instead of keeping compute active unnecessarily.
Green AI also involves reducing unnecessary inference.
A model does not need to run if:
-
A cached answer is acceptable
-
A simpler rule can solve the problem
-
A smaller model can provide adequate quality
-
The task can be grouped efficiently
-
The task can be postponed
-
The requested operation does not actually require AI
This is one of the most important ideas in sustainable AI:
Do not use more computational intelligence than the job requires.
Research is also beginning to examine whether AI coding assistants naturally produce energy-efficient code. A 2025 study comparing LLM-generated Python with human-written and green-software-expert solutions found that no tested LLM consistently beat the experienced green-software expert across the tested hardware platforms. (arXiv)
That finding is a useful warning against assuming that automatically generated code is automatically efficient.

Programming Languages and Energy Consumption
Programming language choice can influence energy consumption, but there is no simple universal rule that one language is always “green” and another is always “bad.”
Energy depends on:
-
The algorithm
-
Compiler or interpreter
-
Runtime
-
Libraries
-
Hardware
-
Input size
-
Implementation
-
Optimization level
-
Workload type
A 2021 study compared programming languages from an energy-efficiency perspective, demonstrating that programming-language choice can matter.
More recent research published in 2025 examined how compiler and interpreter versions affected energy use across C, Java and Python. It reported no clear trend of newer versions automatically becoming more energy efficient and found substantial differences between languages and implementations in its tested workloads. (ScienceDirect)
Therefore, developers should avoid simplistic claims such as “Language X is always green.”
Benchmark the actual application.
Green Software and DevOps
Sustainability also belongs in CI/CD and operations.
A development team can consume unnecessary energy through:
-
Rebuilding software when no meaningful change occurred
-
Running redundant CI jobs
-
Keeping test environments permanently active
-
Deploying oversized infrastructure
-
Maintaining idle development environments
-
Running nonessential automated jobs too frequently
Green DevOps can therefore include:
-
Better pipeline caching
-
Smarter test selection
-
Ephemeral environments
-
Automatic shutdown of idle resources
-
Resource right-sizing
-
Workload scheduling
-
Continuous measurement
The Green Software Patterns catalog specifically includes DevOps-oriented patterns and identifies DevOps engineers as a major practitioner group. (Green Software Patterns)
Green Software and Requirements
A surprising amount of environmental impact can be influenced before anyone writes code.
Suppose a product team requires:
-
Extremely high availability
-
Instant response everywhere
-
Continuous background synchronization
-
Unlimited historical retention
-
Real-time processing for every event
Those requirements can create a much larger infrastructure footprint.
The Green Software Patterns catalog recommends matching service-level objectives to real business needs rather than automatically choosing the highest possible availability or performance target.
This is an important principle because the greenest optimization may sometimes be not building unnecessary functionality in the first place.
Current Green Software Developments in 2026
Green software has developed well beyond the early focus on energy-efficient code.
From Carbon to a Wider Environmental Footprint
In June 2026, the Green Software Foundation officially described a broader vision covering carbon emissions, energy consumption, water usage and waste across the technology stack.
This reflects the rapid expansion of cloud computing and AI.
Software Water Intensity
The Green Software Foundation announced the Software Water Intensity (SWI) project in June 2026 to develop a consistent approach for measuring and reducing software's water footprint. The organization says this is becoming increasingly important as data centers and AI workloads grow.
Real-Time Cloud Energy and Carbon Data
The Foundation's Real-Time Cloud (RTC) standard aims to normalize energy and carbon metadata across major cloud providers. Its current specification describes data including Power Usage Effectiveness, water-related metrics, carbon-free-energy percentages, carbon intensity and grid-region information.
That matters because carbon-aware computing depends on knowing what is happening in the electricity system.
Green Software Patterns v2
The Green Software Patterns initiative is also evolving. Its 2025 roadmap proposed a future where sustainable development guidance becomes integrated into development environments and tooling rather than existing as something developers must remember manually.
The long-term vision includes automated assessment, continuous measurement and AI-assisted optimization, although the Foundation explicitly describes the 2030 vision as a project vision rather than a current standard.
Current Green Software Standards and Projects
| Standard or Project | Purpose | 2026 Status |
|---|---|---|
| SCI | Measure software carbon intensity | ISO/IEC 21031:2024; actively maintained |
| SCI for AI | Extend carbon measurement to AI systems | Published and progressing toward ISO submission |
| SCI for Web | Measure environmental impact of web delivery | Draft development |
| SWI | Measure software water intensity | New 2026 project |
| RTC | Standardize real-time cloud energy/carbon data | Published |
| Green Software Patterns | Practical engineering guidance | Active catalog and v2 development |
| Carbon Aware SDK | Help software respond to carbon-intensity data | Graduated, mature open-source project |
These statuses come from the Green Software Foundation's current standards and project pages. (Green Software Foundation)
Green Software Is Not Just About Making Code Faster
A common misunderstanding is to treat green software as another word for optimization.
They overlap, but they are not identical.
A faster application may still consume more energy if it uses substantially more hardware.
A lower-latency service may require more machines than a slightly slower service.
A carbon-aware application might deliberately delay a nonurgent task.
A highly available architecture may use additional infrastructure that would not be required under a lower availability target.
That is why green software needs a system view.
The question is not simply:
Is this code fast?
The better questions are:
-
How much energy does it use?
-
How much hardware does it require?
-
How much data does it move?
-
What resources does it consume at scale?
-
Could the work be avoided?
-
Could the same result be delivered more efficiently?
-
Could flexible work happen at a cleaner time?
-
Does the application encourage unnecessary hardware replacement?
The Business Benefits of Green Software
Environmental improvements can produce practical business benefits too.
Efficient software may reduce:
-
Cloud bills
-
Infrastructure requirements
-
Battery consumption
-
Network transfer
-
Storage requirements
-
Processing time
-
Operational complexity
This is why green software can complement existing engineering programs rather than compete with them.
A team optimizing resource utilization for cost may also reduce emissions.
A team improving page performance may also reduce device energy consumption.
A team reducing unnecessary infrastructure may reduce both cloud spending and embodied hardware impacts.
The important requirement is to measure the actual result instead of assuming every performance optimization is environmentally beneficial.
Challenges and Limitations
Green software engineering has real difficulties.
Measurement Is Hard
Software runs across layers that developers may not completely control.
A web application may involve:
-
The origin server
-
Cloud infrastructure
-
Third-party services
-
Networks
-
Browsers
-
User devices
The Green Software Foundation's work on SCI for Web specifically discusses comprehensive boundaries, measurement uncertainty and the risk of excluding components that matter.
Not Every Optimization Produces a Net Benefit
Reducing CPU usage could increase memory use.
Reducing network transfer could increase storage.
Increasing caching could create stale-data complexity.
Running workloads in another region could reduce carbon intensity while creating other system or infrastructure concerns.
The Carbon Aware SDK documentation itself notes that location shifting can have unintended effects if additional demand places pressure on local energy systems.
Sustainability Can Conflict With Other Requirements
Safety, security, availability, accessibility, reliability and user experience still matter.
The goal is not to make software as small or slow as possible.
The goal is to make it efficient enough to meet its real purpose without unnecessary environmental cost.
How Developers Can Start
A practical starting process can be surprisingly simple.
1. Measure
Pick one application and identify its major resource consumers.
2. Choose a Useful Functional Unit
For example:
-
Per API request
-
Per transaction
-
Per user session
-
Per model inference
-
Per batch job
3. Find the Biggest Sources of Waste
Do not start with tiny optimizations.
Look for:
-
Excessive compute
-
Large data transfers
-
Idle infrastructure
-
Repeated queries
-
Unnecessary storage
-
Oversized models
-
Frequent polling
-
Inefficient algorithms
4. Apply One Change
For example:
-
Add caching
-
Reduce payload size
-
Right-size infrastructure
-
Reduce polling
-
Improve a slow algorithm
5. Measure Again
Compare before and after.
6. Keep the Change That Actually Helps
The Green Software Patterns process similarly recommends choosing an appropriate pattern, understanding it, applying it and measuring the impact. (Green Software Patterns)
References
-
Green Software Foundation — Revisiting Green Software: From Silicon to Screen, June 4, 2026. Read the Green Software Foundation article
-
Green Software Foundation — Learn Green Software: Introduction. Read the green software introduction
-
Green Software Foundation — Software Carbon Intensity (SCI). Read the SCI standard overview
-
Green Software Foundation — SCI Specification. Read the SCI specification
-
Green Software Foundation — Green Software Patterns. Browse the Green Software Patterns catalog
-
Green Software Foundation — SCI for AI. Read about SCI for AI
-
Green Software Foundation — Software Water Intensity Project. Read about Software Water Intensity
-
Green Software Foundation — Real-Time Energy and Carbon Data for Cloud. Read about the Real-Time Cloud standard
-
Green Software Foundation — Carbon Aware SDK. Read about carbon-aware computing tools
-
Green Software Foundation — Green Software Patterns Development Catalog. Browse development patterns
-
ScienceDirect — Ranking programming languages by energy efficiency. Read the research record
-
ScienceDirect — Does the compiler or interpreter version influence the energy consumption of programming languages? Read the 2025 study
-
arXiv — Generating Energy-Efficient Code via Large-Language Models — Where are we now? Read the research paper.