How Gas Fees Are Calculated on Ethereum

Gas fees on Ethereum are calculated as gas units used x (base fee + priority fee). This post explains how EIP-1559 changed the fee model, what drives each component, and how the Layer 2 roadmap is shifting the economics.
Lewis Jackson
CEO and Founder

Gas fees are one of those things that seem simple until you actually try to calculate one. Most Ethereum users understand they pay fees — they just can't explain why the number they paid is the number they paid.

The confusion usually comes from two places. First, gas pricing changed significantly in August 2021 with EIP-1559, which replaced the old first-price auction model with a two-part structure. Second, the vocabulary layers multiple concepts — gas units, gas limit, base fee, priority fee, gwei — that each contribute to the final number in different ways.

The Formula

Every Ethereum transaction requires computation. The protocol assigns a gas cost to every operation: adding two numbers costs 3 gas units; reading from storage costs 200; writing to storage costs 20,000. Your total gas used is the sum of all operations in your transaction.

Sending ETH directly uses roughly 21,000 gas units. Interacting with a smart contract — swapping tokens, depositing into a lending protocol, minting an NFT — uses more, typically 50,000 to 300,000+ depending on what the contract does.

Since EIP-1559, the fee you pay per gas unit has two components:

Base fee is the minimum price per gas unit required for inclusion in the current block. The protocol sets this — not users. It adjusts automatically based on how full the previous block was. If blocks are consistently above 50% capacity, the base fee rises by up to 12.5% per block. If they're below target, it falls. The base fee is burned, not paid to validators.

Priority fee (also called the tip) is an optional payment you offer validators to prioritize your transaction. When the network is quiet, 1-2 gwei is typically enough. During high-demand events — a popular NFT mint, a major DeFi liquidation cascade — you may need 20-100+ gwei to get included quickly. Validators keep this.

The total transaction cost:

Gas Fee = Gas Units Used x (Base Fee + Priority Fee)

At current conditions, a simple ETH transfer (21,000 gas) at a 10 gwei base fee and 2 gwei tip: 21,000 x 12 gwei = 252,000 gwei = 0.000252 ETH. The numbers shift constantly with network demand.

Gas Limit: The Ceiling You Set

Your wallet also sets — or auto-estimates — a gas limit: the maximum gas units you will allow the transaction to consume. If the transaction uses less, you're refunded the difference. If it hits the limit before finishing, the transaction fails (reverts) and the state change rolls back — but you still paid for the computation that ran.

That asymmetry matters. Setting a gas limit too low is costly. Setting it too high wastes nothing. For smart contract interactions, gas estimation can be tricky because the computation path varies depending on on-chain state at execution time. Your wallet's estimate is usually reliable, but not guaranteed.

Where the Constraints Live

Block space is the binding constraint. Each Ethereum block targets 15 million gas units and caps at 30 million. When sustained demand pushes blocks above target, the base fee rises by up to 12.5% per block — meaning repeated congestion can compound fees exponentially within minutes.

This has a practical implication: fee calculations are time-sensitive. The same transaction that costs $2 at 3am EST might cost $30 during a popular protocol launch. Base fee fluctuates every 12 seconds or so, one block at a time.

Gwei is the unit. One gwei equals one billionth of one ETH. Fee amounts are quoted in gwei because the numbers are more readable — "12 gwei" is clearer than "0.000000012 ETH."

What's Changing

EIP-4844 (deployed March 2024) introduced blob transactions — a new data type designed for Layer 2 rollups to post data to Ethereum at lower cost. This didn't directly change L1 user fees, but it reduced rollup operating costs by roughly 10x, which flowed through to substantially lower fees on networks like Arbitrum, Base, and Optimism.

The longer roadmap includes full danksharding — a multi-phase expansion of blob capacity that could reduce rollup data costs by another order of magnitude. That's still a multi-year process.

Account abstraction (ERC-4337) is also changing how fees work in practice. Smart contract wallets can now sponsor gas for users, accept payment in non-ETH tokens, and batch multiple operations into single transactions. The underlying fee mechanism doesn't change, but the user experience of paying fees is becoming more flexible.

What Would Confirm the Rollup-Centric Direction

Observable signals: Layer 2 transaction volumes continuing to exceed L1 by a wide margin; blob usage scaling without degrading consensus stability; L1 base fees stabilizing as activity migrates to Layer 2s; danksharding phases proceeding on published timelines without major security incidents.

What Would Break It

The fee model comes under pressure if: rollup data availability costs fail to scale despite danksharding; EIP-4844 introduces unforeseen vulnerabilities; sustained spam attacks manipulate base fee signals enough to make estimation unreliable; or competing L1s attract critical DeFi activity before Ethereum's scaling roadmap catches up.

Timing Perspective

Now: L1 Ethereum gas fees are appropriate for large, complex, or security-sensitive settlements, but expensive for small transactions. For anything under roughly $200 in transaction value, Layer 2 networks offer 90%+ cost reduction with comparable security guarantees for most use cases.

Next (2026-2027): More blob capacity, broader DeFi migration to L2s, account abstraction simplifying fee payment for non-technical users.

Later: Whether L1 fees ever become cheap for retail depends on whether the modular architecture fully absorbs demand — or whether L1 remains a settlement layer for high-value transactions while routine activity lives on L2s. The design philosophy points toward the latter.

What This Doesn't Cover

This covers the fee calculation mechanism: gas units x (base fee + priority fee), how each input is determined, and what drives them up or down. It doesn't address gas estimation tools, transaction timing strategies, or the tax treatment of gas fees in any jurisdiction.

The mechanism is stable and well-documented since EIP-1559. The specific numbers are determined by network demand, block by block.

Related Posts

See All
Crypto Research
New XRP-Focused Research Defining the “Velocity Threshold” for Global Settlement and Liquidity
A lot of people looking at my recent research have asked the same question: “Surely Ripple already understands all of this. So what does that mean for XRP?” That question is completely valid — and it turns out it’s the right question to ask. This research breaks down why XRP is unlikely to be the internal settlement asset of CBDC shared ledgers or unified bank platforms, and why that doesn’t mean XRP is irrelevant. Instead, it explains where XRP realistically fits in the system banks are actually building: at the seams, where different rulebooks, platforms, and networks still need to connect. Using liquidity math, system design, and real-world settlement mechanics, this piece explains: why most value settles inside venues, not through bridges why XRP’s role is narrower but more precise than most narratives suggest how velocity (refresh interval) determines whether XRP creates scarcity or just throughput and why Ripple’s strategy makes more sense once you stop assuming XRP must be “the core of everything” This isn’t a bullish or bearish take — it’s a structural one. If you want to understand XRP beyond hype and price targets, this is the question you need to grapple with.
Read Now
Crypto Research
The Jackson Liquidity Framework - Announcement
Lewis Jackson Ventures announces the release of the Jackson Liquidity Framework — the first quantitative, regulator-aligned model for liquidity sizing in AMM-based settlement systems, CBDC corridors, and tokenised financial infrastructures. Developed using advanced stochastic simulations and grounded in Basel III and PFMI principles, the framework provides a missing methodology for determining how much liquidity prefunded AMM pools actually require under real-world flow conditions.
Read Now
Crypto Research
Banks, Stablecoins, and Tokenized Assets
In Episode 011 of The Macro, crypto analyst Lewis Jackson unpacks a pivotal week in global finance — one marked by record growth in tokenized assets, expanding stablecoin adoption across emerging markets, and major institutions deepening their blockchain commitments. This research brief summarises Jackson’s key findings, from tokenized deposits to institutional RWA chains and AI-driven compliance, and explains how these developments signal a maturing, multi-rail settlement architecture spanning Ethereum, XRPL, stablecoin networks, and new interoperability layers.Taken together, this episode marks a structural shift toward programmable finance, instant settlement, and tokenized real-world assets at global scale.
Read Now

Related Posts

See All
No items found.
Lewsletter

Weekly notes on what I’m seeing

A personal letter I send straight to your inbox —reflections on crypto, wealth, time and life.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.