What is the Ethereum Virtual Machine (EVM)?
The EVM is the shared virtual computer that runs Ethereum's smart contracts on every node.1 Given the same input, it always gives the same output, and gas limits how much work it does.1,2
One machine, run everywhere
The EVM is a virtual computer. It runs code the same way, safely, on every Ethereum node.1 Nodes run it to carry out smart contracts.1 It is the place where smart contract code actually runs.3
A machine that changes state
A blockchain like Bitcoin is often described as a shared ledger: a record of activity that must follow set rules.1 Ethereum's state holds more. It has every account and balance, plus a machine state that changes from block to block by fixed rules.1 The EVM defines those rules.1
The EVM behaves like a maths function. Give it the same input, and it always gives the same output.1 In short: take the old state, apply a batch of valid transactions, and you get the new state.1 That is how every node can run the same code and reach the same result.1
From Solidity to bytecode
The EVM cannot read languages like Solidity. Code is first compiled into bytecode: low-level machine instructions.4 Bytecode runs as small steps called opcodes.1 Some do basic sums, such as ADD and SUB. Others are special to blockchains, such as BALANCE and BLOCKHASH.1
The EVM is a stack machine. It works on a pile of values up to 1,024 items deep, and each item is 256 bits.1,5
Sealed off from the outside
Code running in the EVM has no access to the network, to files, or to other programs on the computer.3 So a smart contract needs an oracle to learn outside facts. ethereum.org says this is by design: relying on outside data could put consensus at risk.6
Where data lives
Each contract has its own storage, which lasts between function calls and between transactions.3 The EVM also has memory, which is wiped after each transaction.1 Storage is costly to read, and even more costly to change.3 A contract can only read and write its own storage.3
Gas: the meter on the machine
Gas measures how much computing work an operation needs.2 Each transaction sets a gas limit: the most gas it may use. This stops mistakes or attacks that would loop forever.2,7 The Yellow Paper calls the EVM "quasi-Turing-complete" for this reason: gas puts a ceiling on the total work.5
A standard ETH transfer uses 21,000 gas.2 Set a limit of 50,000 for one, and 21,000 is used. The other 29,000 comes back to you.2 If a contract runs out of gas halfway, the EVM undoes its changes, but all the gas is still used up.2 You pay the fee whether a transaction succeeds or fails.2
This lesson treats gas as a meter. Module 5 explains how gas prices and fees are worked out.
Many versions, one rulebook
Ethereum nodes run software called execution clients, and each one includes its own EVM.1,8 There are also stand-alone versions in Python, C++, JavaScript and Rust.1 All of them must follow the rules set out in the Yellow Paper.1
- Ethereum Virtual Machine (EVM). ethereum.org developer docs, page updated 26 July 2026.
- Gas and fees. ethereum.org developer docs, page updated 24 June 2026.
- Introduction to Smart Contracts (the SimpleStorage example and the EVM overview). Solidity documentation, The Solidity Authors.
- Verifying smart contracts. ethereum.org developer docs, page updated 22 October 2025.
- Ethereum: A Secure Decentralised Generalised Transaction Ledger (the Yellow Paper), Shanghai version. Gavin Wood, Ethereum Yellow Paper, version efc5f9a, 4 February 2025.
- Introduction to smart contracts. ethereum.org developer docs, page updated 25 February 2026.
- Ethereum Whitepaper: A Next-Generation Smart Contract and Decentralized Application Platform. ethereum.org (the original paper by Vitalik Buterin).
- The Merge. ethereum.org roadmap, page updated 15 May 2026.
General education built from the publicly available sources listed above. Not financial, legal, tax or investment advice. Naming a company, project or regulator is not an endorsement either way. Last checked 2026-10-22. Terms and disclaimer.