ESP8266 vs ESP32: Choosing the Right Board for Your Project
The ESP8266 was the board that made WiFi-connected microcontroller projects genuinely cheap and accessible, years before the ESP32 existed, and it's still in production, still inexpensive, and still the better choice for a real subset of projects — it isn't simply an obsolete predecessor to the ESP32. This guide covers the actual differences that matter when picking between them, rather than defaulting to "always use the newer one."
Core Specs Compared
SpecESP8266ESP32 (base variant) CPUSingle-core, ~80-160MHzDual-core (most variants), up to 240MHz RAM~50-80KB usable520KB SRAM (base variant), more on -S3 WirelessWiFi only (2.4GHz)WiFi + Bluetooth Classic/BLE GPIO count~9-11 usable pins, several with quirks/restrictions25-35+ usable pins depending on variant ADC channels1 (10-bit)Multiple (12-bit), though with known non-linearity that needs calibration for precision work PeripheralsBasic UART/I2C/SPI, no true hardware PWM on most pinsFull hardware PWM (LEDC), CAN (TWAI), I2S, capacitive touch, more UART/SPI/I2C buses Typical priceOften under $2-3 for bare modulesUsually $3-6 for base variants, more for -S3/-C6When ESP8266 Is Still the Right Choice
For a genuinely simple WiFi project — a single sensor reporting to MQTT, a basic web-controlled relay, a status indicator — the ESP8266 does the whole job with less board cost and a smaller physical footprint (particularly the ESP-01 module) than an ESP32 is going to offer for the same task. Its lower RAM and single core are real constraints, but they're constraints that plenty of simple IoT projects never actually hit; you don't need dual-core processing power or Bluetooth to blink an LED based on a web request or push a temperature reading every few minutes. If a project's bill-of-materials cost matters at any real scale (building ten or a hundred of the same sensor node), the ESP8266's lower per-unit cost adds up.
When ESP32 Is the Right Choice
Once a project needs Bluetooth alongside WiFi, more than a handful of GPIO pins, real hardware PWM for motor or servo control, CAN bus, I2S audio, or enough processing headroom to run a real-time task (a control loop) alongside networking code, the ESP32 isn't just nicer to have — it's often the only one of the two that can actually do the job. The dual-core architecture in particular matters for projects doing meaningful local processing (sensor fusion, local device control) while also handling WiFi/network traffic, since the ESP8266's single core has to time-slice between networking and everything else, which shows up as jitter in timing-sensitive applications.
Common Pitfalls Specific to Each
ESP8266 boards have a handful of boot-mode pin restrictions and a genuinely tight RAM budget that trips up projects that grew beyond their original simple scope — a sketch that worked fine at first can start throwing out-of-memory errors once you add a web server, TLS, and JSON parsing together, since TLS/HTTPS connections in particular eat a disproportionate share of the ESP8266's limited RAM. ESP32 boards have their own quirks: ADC2 channels are unusable while WiFi is active on most variants (a common source of "my sensor readings are garbage when WiFi is on" confusion), and the growing family of variants (base ESP32, S2, S3, C3, C6, H2) differ enough in peripherals and even core architecture (some are single-core RISC-V rather than dual-core Xtensa) that "ESP32" alone isn't always a precise enough spec to guarantee compatibility with a given tutorial or library.
Migration Notes
Code written for ESP8266 in the Arduino framework generally needs at least minor changes to run on ESP32 — pin numbering conventions differ, some ESP8266-specific libraries (particularly anything touching low-level WiFi or the single ADC) have ESP32 equivalents that aren't drop-in replacements, and PWM setup is handled by an entirely different API (LEDC on ESP32 versus the simpler analogWrite-style calls common on ESP8266 boards). Budget real time for this migration rather than assuming recompiling for a different board target is sufficient.
Decision Guide
If your project needs...Choose Just WiFi, simple I/O, lowest cost per unitESP8266 Bluetooth, more GPIO, hardware PWM, CAN, I2SESP32 Real-time control loop alongside networkingESP32 (dual-core headroom) Smallest possible physical footprint on a budgetESP8266 (ESP-01 module) Future-proofing a design you'll keep expandingESP32 — more headroom to grow intoThe ESP8266 isn't a legacy part to avoid by default — for the narrow, genuinely simple WiFi tasks it was designed for, it remains cheaper and smaller than reaching for an ESP32 out of habit. Match the board to what the project actually needs rather than defaulting to whichever chip is newer, and budget real migration time if a project outgrows an ESP8266 and needs to move up.
Related Guides
- Arduino vs ESP32: Which Should You Use? A Practical Comparison
- Getting Started with ESP32: GPIO, WiFi, and Your First Project
- ESP32-WROOM-32
- Choosing the Right ESP32 Variant: ESP32, S2, S3, C3, and C6 Compared
- Choosing a Wireless Protocol for Maker Projects: WiFi, Bluetooth, Zigbee, Z-Wave, LoRa, and Thread Compared
- ESPHome and Home Assistant Beginner Guide: Build Your First WiFi Sensor
- ESP32-C6
- I2C vs SPI vs UART: How to Choose and Use Serial Communication Protocols