Hardware Reference · Pre-Upload Conflict Guard

ESP32 Pinout Diagram & Safe GPIO Guide

Stop guessing which pins crash boot or drop ADC readings under Wi-Fi. Filter safe I2C, SPI, ADC1, input-only, boot-strap, and SPI flash pins across ESP32 WROOM (30-pin & 38-pin DevKit) and ESP32-S3 / Arduino Nano ESP32—or check every sketch automatically inside FlashCode IDE before flashing.

Pin Primary Role Status Hardware Notes & Conflict Guard
GPIO 0 Boot Strap / ADC2 / Touch Caution Pulling LOW at boot enters serial bootloader. Avoid external pull-downs.
GPIO 1 UART0 TX (USB Serial) Caution Used for USB serial debug & flashing. Avoid driving peripherals.
GPIO 2 Boot Strap / Onboard LED Caution Must be LOW or floating during serial flash on most WROOM DevKits.
GPIO 3 UART0 RX (USB Serial) Caution Shared with USB serial RX. HIGH at boot recommended.
GPIO 4 ADC2_CH0 / Touch / PWM Safe General purpose GPIO. Note: ADC2 is unavailable while Wi-Fi is active.
GPIO 5 VSPI CS / Boot Strap Caution Outputs PWM signal at boot; safe as SPI CS with pull-up.
GPIO 6–11 Internal SPI Flash (CLK/D0–D3/CMD) Do Not Use Connected to internal SPI flash on ESP32-WROOM. Using these crashes the MCU.
GPIO 12 MTDI / Boot Strap (Flash Voltage) Do Not Use HIGH at boot selects 1.8V flash and can prevent booting on 3.3V modules.
GPIO 13 General GPIO / HSPI MOSI Safe Safe general GPIO & PWM. ADC2 unavailable when Wi-Fi is active.
GPIO 14 General GPIO / HSPI SCK Safe Outputs brief PWM pulse on boot; otherwise safe GPIO.
GPIO 15 MTDO / Boot Strap Caution Controls ROM boot log output; keep HIGH/floating during boot.
GPIO 16 UART2 RX / General GPIO Safe Safe digital I/O & UART2 RX (avoid on WROVER boards with PSRAM).
GPIO 17 UART2 TX / General GPIO Safe Safe digital I/O & UART2 TX (avoid on WROVER boards with PSRAM).
GPIO 18 VSPI SCK / General GPIO Safe Clean digital I/O, PWM, and default VSPI clock.
GPIO 19 VSPI MISO / General GPIO Safe Clean digital I/O, PWM, and default VSPI MISO.
GPIO 21 Default I2C SDA Safe Standard Arduino ESP32 I2C SDA pin. Clean digital I/O.
GPIO 22 Default I2C SCL Safe Standard Arduino ESP32 I2C SCL pin. Clean digital I/O.
GPIO 23 VSPI MOSI / General GPIO Safe Clean digital I/O, PWM, and default VSPI MOSI.
GPIO 25 DAC1 / ADC2_CH8 Safe 8-bit DAC1 output and clean GPIO/PWM.
GPIO 26 DAC2 / ADC2_CH9 Safe 8-bit DAC2 output and clean GPIO/PWM.
GPIO 27 General GPIO / Touch Safe Clean digital I/O and PWM.
GPIO 32 ADC1_CH4 / Touch / PWM Safe Safe ADC1 input (works alongside Wi-Fi) plus full output driver.
GPIO 33 ADC1_CH5 / Touch / PWM Safe Safe ADC1 input (works alongside Wi-Fi) plus full output driver.
GPIO 34 Input-Only (ADC1_CH6) Caution Input-only: no output driver and no internal pull-up or pull-down resistor.
GPIO 35 Input-Only (ADC1_CH7) Caution Input-only: no output driver and no internal pull-up or pull-down resistor.
GPIO 36 (VP) Input-Only (ADC1_CH0) Caution Input-only: ideal for Wi-Fi-safe analog sensors with external pull resistors.
GPIO 39 (VN) Input-Only (ADC1_CH3) Caution Input-only: ideal for Wi-Fi-safe analog sensors with external pull resistors.

Showing ESP32 DevKit WROOM GPIO mapping (3.3V logic).

30-Pin vs 38-Pin ESP32

WROOM DevKit Differences

30-pin ESP32 DevKits omit the internal SPI flash pins (GPIO6–11) and GPIO0 on some revisions, whereas 38-pin boards expose them. Never wire peripherals to GPIO6–11 on 38-pin boards.

Arduino Nano ESP32 Pinout

ESP32-S3 Silkscreen Mapping

The Arduino Nano ESP32 runs on an ESP32-S3 with Arduino pin numbering (D2–D13, A0–A7). A4/SDA is GPIO11 and A5/SCL is GPIO12.

Pre-Upload Safety

Automatic Pin Scanner

FlashCode IDE scans pinMode(), analogRead(), and bus calls in your .ino sketch and highlights pinout conflicts right inside the editor before you flash.

ESP32 Pinout FAQ

Which ESP32 GPIO pins are safest for general digital I/O, I2C, and SPI?

On a standard 30-pin or 38-pin ESP32 WROOM DevKit, GPIO 4, 13, 16, 17, 18, 19, 21 (I2C SDA), 22 (I2C SCL), 23, 25, 26, 27, 32, and 33 are the safest output-capable pins. Avoid GPIO 6–11 (internal SPI flash) and be careful with boot strapping pins (GPIO 0, 2, 5, 12, 15).

Why do GPIO 34, 35, 36, and 39 fail as outputs on ESP32?

GPIO 34–39 on the classic ESP32 are hardware input-only pins. They lack output drivers and internal pull-up/pull-down resistors, so digitalWrite() or OUTPUT mode will not drive external LEDs, relays, or I2C lines.

Why do analogRead() calls fail on ESP32 when Wi-Fi is turned on?

ESP32 ADC2 channels (GPIO 0, 2, 4, 12–15, 25–27) share hardware with the Wi-Fi radio. Whenever Wi-Fi is active, use ADC1 pins instead: GPIO 32, 33, 34, 35, 36 (VP), or 39 (VN).

How is the Arduino Nano ESP32 pinout mapped compared to ESP32-S3?

The Arduino Nano ESP32 uses the ESP32-S3 (u-blox NORA-W106) and maps Arduino silkscreen labels (D2–D13, A0–A7) to ESP32-S3 GPIOs—for example A4/SDA maps to GPIO 11 and A5/SCL maps to GPIO 12. FlashCode IDE tracks both board profiles and flags strapping or USB conflicts automatically.

Get FlashCode IDE

Ship firmware faster today.

Native packages for Linux (x86_64). Free Apache-2.0 open-source core, source-available AI agent free for personal use, zero telemetry.

Quick Install (Debian / Ubuntu)
sudo apt install ./flashcode_*.deb