ESP32 GPIO Pinout & Functions
What each GPIO on the classic ESP32 can do, and which ones not to touch.
What it does: Look up the capabilities and pitfalls of each ESP32 GPIO: input-only, strapping, ADC, forbidden pins.
When to use it: When assigning pins, debugging boot failures / ADC issues, or avoiding the Flash pins.
Disclaimer: This result is a reference estimate. For actual production, refer to the device datasheet / local regulations as authoritative.
⚠ This is the chip GPIO function mapping, not the physical header order of any one board — when wiring, also check the silkscreen/pinout of your dev board.
strapping pins? are marked with ⚑; input-only is marked IN; forbidden pins have the whole row dimmed.
| GPIO | Direction | ADC | Touch | Default | Caution |
|---|---|---|---|---|---|
| 0⚑ | I/O | ADC2 | T1 | — | Boot mode select pin; connect a button / pull-up, a low level enters download mode. |
| 1 | I/O | — | — | U0TXD | Default UART TX (flashing/log); avoid using it if possible. |
| 2⚑ | I/O | ADC2 | T2 | — | On some boards tied to the on-board LED; must be low/floating during download. |
| 3 | I/O | — | — | U0RXD | Default UART RX; avoid using it if possible. |
| 4 | I/O | ADC2 | T0 | — | |
| 5⚑ | I/O | — | — | VSPI CS | Outputs PWM by default at power-on; strapping. |
| 6 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 7 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 8 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 9 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 10 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 11 | Forbidden | — | — | — | Connected to on-board SPI Flash — do not use. |
| 12⚑ | I/O | ADC2 | T5 | MTDI / HSPI MISO | strapping: must not be high at power-on (it sets the flash voltage). |
| 13 | I/O | ADC2 | T4 | HSPI MOSI | |
| 14 | I/O | ADC2 | T6 | HSPI CLK | Outputs a PWM signal at power-on. |
| 15⚑ | I/O | ADC2 | T3 | HSPI CS | Outputs PWM by default at power-on; strapping. |
| 16 | I/O | — | — | — | |
| 17 | I/O | — | — | — | |
| 18 | I/O | — | — | VSPI CLK | |
| 19 | I/O | — | — | VSPI MISO | |
| 21 | I/O | — | — | I2C SDA (default) | |
| 22 | I/O | — | — | I2C SCL (default) | |
| 23 | I/O | — | — | VSPI MOSI | |
| 25 | I/O | ADC2 | — | DAC1 | |
| 26 | I/O | ADC2 | — | DAC2 | |
| 27 | I/O | ADC2 | T7 | — | |
| 32 | I/O | ADC1 | T9 | — | |
| 33 | I/O | ADC1 | T8 | — | |
| 34 | Input-only | ADC1 | — | — | Input-only; no internal pull-up/down. |
| 35 | Input-only | ADC1 | — | — | Input-only; no internal pull-up/down. |
| 36 | Input-only | ADC1 | — | SENSOR_VP | Input-only; no internal pull-up/down. |
| 39 | Input-only | ADC1 | — | SENSOR_VN | Input-only; no internal pull-up/down. |
MEANS Prefer ordinary I/O pins with no special markings; when you need ADC and Wi-Fi is on, stick to ADC1 (32–39).
No history yet. Each calculation is automatically saved to this device.
How to use the ESP32 GPIO reference
Avoid forbidden pins → mind strapping → pick the right ADC.
- 01
Avoid the forbidden pins first
GPIO6–11 connect to the on-board Flash and must never be used; 34/35/36/39 are input-only with no internal pull-up/down.
- 02
Watch the strapping pins
GPIO0/2/5/12/15 affect power-on boot; when connecting peripherals, make sure the level at the power-on instant is correct.
- 03
Pick the right ADC
ADC2 is unavailable when Wi-Fi is on, so prefer ADC1 (GPIO32–39).
Quick pitfalls
Before wiring, scan these few categories of special pins.
| Category | GPIO | Notes |
|---|---|---|
| Forbidden | 6 · 7 · 8 · 9 · 10 · 11 | Connected to on-board SPI Flash |
| Input-only | 34 · 35 · 36 · 39 | No output, no internal pull-up/down |
| Strapping | 0 · 2 · 5 · 12 · 15 | Power-on level affects boot mode |
| Default UART | 1 (TX) · 3 (RX) | Used by flashing/log |
| Default I2C | 21 (SDA) · 22 (SCL) | Remappable |
Espressif ESP32 datasheet / TRM (WROOM-32).
Common questions, answered in 3 minutes
Why does my board fail to boot as soon as I use a certain pin?
You most likely hit a strapping pin (0/2/5/12/15). For example, if GPIO12 is high at power-on it can make the Flash voltage decision wrong; the level on these pins at the power-on instant must meet the requirements.
ADC readings jump around or read nothing?
ADC2 (GPIO0/2/4/12-15/25-27) is unavailable while Wi-Fi is on. Move the analog input to ADC1 (GPIO32–39).
Why does a button on GPIO34–39 not work?
They are input-only and have no internal pull-up/down, so you must add an external pull-up/pull-down resistor, otherwise the level floats.
The physical pins do not match this table?
This is the chip-level "GPIO number → function" mapping; the physical header order differs by dev board, so also check the silkscreen/pinout of your specific board.
Does it apply to ESP32-S3 / C3?
No. This table is for the classic ESP32 (WROOM-32). The S2/S3/C3 and others are different chips with different GPIO capabilities and numbering.
Standards and sources referenced by this tool
| Item | Value / Formula | Source |
|---|---|---|
| GPIO capabilities | Classic ESP32 / WROOM-32 | Espressif datasheet |
| ADC1/ADC2 | ADC2 conflicts with Wi-Fi | ESP32 TRM |
Chip-level GPIO mapping; the physical header order varies by board, so always also check the pinout of your dev board and the official datasheet.