Try it Live
Run BaseFeePerGas examples in the interactive playground
BaseFeePerGas
EIP-1559 base fee per gas representing the minimum gas price required for transaction inclusion. The base fee is dynamically adjusted each block based on network congestion and is burned (removed from circulation).Overview
Branded bigint type representing base fee in Wei. Adjusts ±12.5% per block targeting 50% block fullness (15M gas target, 30M max).Quick Start
Type Definition
API
Construction
from(value)
Create from bigint, number, or hex string.
fromGwei(gwei)
Create from Gwei value.
fromWei(wei)
Create from Wei value (alias for from).
Conversion
toGwei(baseFee)
Convert to Gwei.
toWei(baseFee)
Convert to Wei (identity).
toNumber(baseFee)
Convert to number. Warning: precision loss on large values.
toBigInt(baseFee)
Convert to bigint (identity).
Comparison
equals(baseFee1, baseFee2)
Check equality.
compare(baseFee1, baseFee2)
Compare values. Returns -1, 0, or 1.
EIP-1559 Base Fee Mechanics
Dynamic Adjustment
Base fee adjusts each block targeting 50% capacity:- Target gas: 15M per block
- Max gas: 30M per block
- Adjustment: ±12.5% max per block
Calculation Formula
Fee Burning
Base fee is burned (removed from supply):Real-world Examples
Parse Block Header
Typical Fee Ranges (2024)
Fee Monitoring
Related Types
- MaxFeePerGas - Maximum total fee willing to pay
- MaxPriorityFeePerGas - Maximum tip to miner
- EffectiveGasPrice - Actual price paid
Specification
- EIP-1559: Fee market change for ETH 1.0 chain
- London hard fork (August 2021)
- Target: 15M gas, Max: 30M gas per block
- Adjustment: ±12.5% per block

