Finance & Economics / Blockchain & Crypto

Ethereum Gas Usage Calculator

Understanding Ethereum Gas

What is Gas?

Gas is a unit of computational work on Ethereum. Each operation (opcode) consumes a specific amount of gas. Total transaction cost = Gas Units × Gas Price.

Common Gas Costs:

  • 21,000: Basic ETH transfer (minimum)
  • SSTORE: 20,000 (new slot) or 5,000 (existing)
  • SLOAD: 2,100 (warm) or 2,600 (cold)
  • ADD/SUB: 3 gas per operation
  • MUL/DIV: 5 gas per operation
  • SHA3/Keccak256: 30 + 6 per word

Gas vs. Gas Price:

Transaction Cost = Gas Units × Gas Price (Gwei)
Example: 21,000 gas × 50 Gwei = 1,050,000 Gwei = 0.00105 ETH

Why Different Costs?

  • Reading data: Cheaper (SLOAD)
  • Writing data: Expensive (SSTORE)
  • Complex calculations: More gas
  • Storage operations: Most expensive
  • Purpose: Prevent spam, incentivize efficiency

💡 Important Notes:

  • Gas units are fixed per operation
  • Gas price fluctuates with network demand
  • Complex smart contracts use more gas
  • EIP-1559 introduced base fee + priority fee model
  • Layer 2 solutions offer much lower gas costs