Coffee’s Hidden Gas
When coffee is roasted, heat causes chemical reactions that create gases, with a big chunk being carbon dioxide (CO2). The CO2 that doesn’t escape during roasting gets trapped in the porous structure of the roasted beans and is slowly released at different stages. Looking closely at the presence and behaviour of CO2 in coffee can tell us lots of interesting things, about freshness, shelf life, packaging, brewing, extraction, and even the taste in your final cup. CO2 is actually a pretty underrated and often overlooked part of coffee, so let’s delve a little deeper.
People often ask me what my favourite coffee fact is, and it always takes me back to when I first began researching coffee as a scientist. One of my early projects involved designing a special coffee holder for precise weight measurements. This holder was placed on an analytical lab scale that tracked the weight of coffee samples over several months.
The scale was so accurate that it could detect tiny changes caused by buoyancy, which is the air pushing up on the coffee. To ensure reliable results, we placed everything in a temperature-controlled chamber and adjusted for changes in air pressure. Without these corrections, even a summer storm could disrupt the data. The setup was so sensitive that it detected the shockwave from the 2022 Hunga Tonga–Hunga Haʻapai volcanic eruption. We detected it not just once, but twice, as the wave travelled around the Earth in both directions! The goal of this experiment was to carefully track how roasted coffee loses weight over time. This brings me to my favourite coffee fact: freshly roasted coffee contains about one per cent of its weight as gas.

Generation of carbon dioxide
The gas trapped inside coffee beans after roasting significantly influences how we store and brew coffee. But how can beans hold so much gas? While one per cent by weight may not sound like much, it adds up to about five litres of gas per kilogram of coffee. Roasted coffee beans can retain gas remarkably well. During roasting, a large amount of gas, primarily carbon dioxide, is produced. About half of this gas escapes through the roaster’s exhaust, while the remainder is retained inside the beans. It’s fascinating to think that so much gas can remain trapped. If we calculate the pressure this gas would exert if it filled the space inside the bean, it amounts to around five bar, five times the ambient pressure. This ability to hold so much gas is due to the unique structure of the beans after roasting.
Retention after roasting
During roasting, coffee beans undergo significant chemical changes. One of the most important reactions is the Maillard reaction, which produces melanoidins responsible for the brown colour of roasted beans. While this colour change is visible, another crucial transformation is less apparent: the beans expand and become porous. As they grow, tiny pores form throughout their structure. These pores, about the size of the width of a human hair, are remnants of the bean’s original biological cells. They enable roasted coffee to trap pressurized carbon dioxide, while the solid parts of the bean—previously cell walls—trap the gas and release it slowly over time. This slow release is commonly referred to as degassing, although the more accurate term would be outgassing, as it occurs naturally without external influence. Nevertheless, most people, including scientific literature, continue to use the term degassing.
Post-roast release
After roasting, the carbon dioxide trapped inside coffee beans is gradually released over a period of about three weeks to two months. The amount of gas released and the rate depend on both the roasting process and the type of green bean used. Generally, darker roasts tend to retain more carbon dioxide and release it more quickly than lighter roasts. Fast roasts also release gas more rapidly than slower ones, even if the total amount is only slightly higher for fast roasts. For example, a fast medium roast will expel its gas sooner than a slow dark roast, despite the dark roast likely containing more overall.

The situation becomes more complex when we consider different green bean varieties. Measuring gas release takes approximately three months per sample, so collecting sufficient data across a wide range of beans is a slow endeavour. I’ve often remarked that we should have this data by now, but the reality is that experiments funded by projects take priority, often limiting tests to specific samples specific samples and conditions. Running separate degassing experiments for different beans is challenging, as even minor changes in temperature conditions of the experiment could ruin a long-running degassing measurement.
Still, we do know a few things about the impact of green coffee. For instance, robusta coffee tends to contain about 50 per cent more gas than Arabica. The total gas content doesn’t vary much among coffees from different origins, processing methods, or even decaffeinated beans. However, the rate of gas release can differ significantly. This variation may be linked to bean density, as denser beans seem to trap carbon dioxide more effectively, which could explain their slower release.
The escape valve
The storage of carbon dioxide in coffee beans is already a complex topic, but it becomes even more intriguing when we look at how this gas affects coffee after roasting. The most apparent effect occurs when one kilogram of freshly roasted coffee is placed in a sealed bag. This coffee will release around five litres of carbon dioxide. If the bag is tightly sealed, the pressure from the gas could cause it to burst.
That’s why most coffee bags are equipped with a built-in one-way valve. This valve allows carbon dioxide to escape while preventing air from entering, thus avoiding pressure buildup and keeping the coffee fresh. Contrary to a common myth, the valve does not selectively release carbon dioxide; it releases all gas present in the coffee bag. Packaging becomes trickier with single-serve products like coffee capsules. In these cases, most degassing occurs after the beans are ground, as ground coffee releases gas much faster than whole beans.
The goal with capsules is to package the coffee at just the right moment, when there’s still a small amount of carbon dioxide left. This ensures that the capsule’s lid remains slightly pressurized and maintains its shape.

In full bloom
One of the most fascinating roles carbon dioxide plays in coffee is during extraction. Fresh coffee contains carbon dioxide, while stale coffee does not, allowing us to assess freshness. This is most evident during pour-over brewing, particularly in the blooming stage.
When a splash of hot water first hits the bed of ground coffee, surface tension draws the water into the coffee particles. As the water soaks in, it pushes out the trapped carbon dioxide. While carbon dioxide can dissolve in water, it doesn’t do so well at the high temperatures used for brewing. Instead, it escapes as gas, forming bubbles, what we call the bloom.
A similar phenomenon occurs during coffee cupping. The bubbles help form and stabilize the crust that floats on top of the cup. If the coffee is stale and has already lost its carbon dioxide, there will be little to no blooming, and the crust won’t form properly. This is a simple but powerful way to detect freshness.
Push it, push it
Carbon dioxide also plays a critical role in espresso. Like in pour-over, a process similar to blooming helps create the espresso’s signature crema. As hot water is forced through the coffee grounds, it pushes out the trapped carbon dioxide. Since espresso uses very fine grounds, there is less gas left in the particles when brewing. Many of the tiny pores that held the gas are destroyed during grinding at the finer settings required for espresso.
But there’s one big difference between pour-over and espresso: pressure. Gases dissolve better in water under high pressure, and even if they don’t dissolve, the pressure compresses the bubbles. During espresso extraction, as water moves through the puck and the pressure drops from elevated to ambient levels, carbon dioxide begins to form bubbles. This gradual yet rapid release creates the fine, creamy layer of foam known as crema.

Thicker flows
Crema formation during espresso extraction has another interesting effect: it alters the viscosity of the liquid. As bubbles form and spread through the coffee puck, they change the flow of the espresso. Depending on the amount of carbon dioxide in the grounds, the pressure or extraction time required for consistent extraction can vary.
As coffee ages and loses carbon dioxide, the flow rate becomes faster. To maintain consistent extraction, you need to adjust the grind size. Less carbon dioxide means a finer grind is needed to slow down the flow. Therefore, older coffee requires a finer grind for espresso. Interestingly, very fresh coffee also needs to be ground fine, although the reasons for this are not yet entirely clear.
For about the first week after roasting, you should set your grinder to initially the finest setting. Then, as the coffee ages, the optimal grind size will gradually become coarser. Around one to two weeks after roasting, there is typically a period I call ‘peak freshness’, when the grind size is coarsest. After that, as more carbon dioxide escapes, you will need to start grinding finer again. As I mentioned earlier, ground coffee releases gas much faster than whole beans. If you’ve ever dialled in a fresh coffee but waited a few minutes before pulling the shot, you may have noticed a difference. Even in just five minutes, ground coffee can release as much carbon dioxide as whole beans do over several days. This rapid release can speed up the shot, making it flow faster than if you’d brewed it immediately after grinding.
Curious emissions
The story of carbon dioxide and coffee degassing is surprisingly complex. Scientists still don’t fully understand all the fundamental physical mechanisms behind gas release. Yet, it greatly influences how we store, handle, and brew coffee, and the effects can be confusing and unpredictable.
The rate at which carbon dioxide escapes depends on various factors: the type of green coffee, how it was processed, the roast profile and level, storage temperature, whether the bag has been freshly opened, grind size, and more. With so many variables at play, it’s nearly impossible to establish a one-size-fits-all rule, which is why effectively handling coffee often comes down to experience and intuition.
So, when I say that my favourite coffee fact is that freshly roasted coffee contains one per cent of its weight as gas, it’s not just because that number is surprisingly large. It’s because it represents the science and the way it influences coffee at every stage from bean to cup.
Keep reading
Become a reader—from $60/year
A membership helps us stay independent, create a whole range of stories across our different platforms, and continue to invest in creative community we work with.
Join Standart Already a reader? Log-in here.
Explore more stories
Rachel Apple is a Cup of Excellence Head Judge, photographer, and co-founder of Raise the Bar, a community and education platform for specialty coffee professionals. She loves bin diving for vinyl,...

As the sun set in Zimbabwe’s lush Honde Valley, I watched kids push car tyres up and down the street, racing each other through the village. In Africa, most often, less is more. People are used to ...
Los Angeles resists clean outlines, and its coffee culture lives somewhere between softness and grit. Built from migration, precarious work, and long-standing food traditions, it moves at uneven te...

Tinashe Nyamudoka, founder of Kumusha Wines and Kumusha Coffee, is more than a world-class sommelier; he is a symbol of how wine, culture, and competition can challenge global narratives about tast...
When exploring foreign lands, few feelings compare to the triumph of discovering something known only to locals. Realizing these euphoric moments requires a healthy pinch of boldness, however; one ...

Some coffee origins are still in the process of becoming. Malawi is one of them—a place where potential feels tangible even if not fully realized. Farmers are steadily shaping a future for their co...
Blue-sky ski days to negroni nights, Hakuba is a 24-hour town hidden in the Japanese highlands. From the staunch octogenarian locals fiercely guarding their old traditions, to the young crowd of mu...

In recent years, matcha has become one of the most popular drinks ordered and enjoyed in cafes around the world. But with its growing popularity, several issues have also emerged, ranging from a la...
As coffee grew cheaper in 18th-century Europe, it spread beyond the elite, alarming German rulers. In Prussia, Frederick the Great saw it as a threat to order, economy, and authority. His efforts t...
Valtteri Bottas is a known quantity at Standart, being as he is a past interviewee and co-owner of Finnish roastery Kahiwa. He moves quickly, and not only when he’s piloting an earthbound rocket ar...

