ESP32 Pinout Guide: Safe GPIO Choices for Real Projects
“Any ESP32 peripheral can be routed to any GPIO” is technically tempting and practically dangerous. The GPIO matrix is flexible, but it does not erase boot strapping, flash connections, input-only pins, ADC limitations or electrical limits. A pin can work after startup yet prevent the board from booting when an external relay, pull resistor or sensor drives it during reset.
Direct answer: For the classic ESP32, choose GPIOs only after checking the exact chip, module and development-board schematic. Avoid GPIO6–11 because they normally connect to SPI flash; GPIO34–39 are input-only; ADC2 analog channels conflict with Wi-Fi operation; and strapping pins need valid levels during reset. ESP32 GPIO is 3.3 V logic and should not be treated as 5 V tolerant.
This guide focuses on the original ESP32/ESP32-WROOM-32 family and common DevKitC-style boards. ESP32-S2, S3, C3, C6 and other variants have different pin maps. Do not transfer this table to another family by name alone.
Chip Pin, Module Pin or Board Label?
An ESP32 pinout can describe three different things:
- the QFN chip pads;
- the castellated pins of a WROOM/WROVER module;
- the header labels of a development board.
Those are not interchangeable. A module uses some chip pins internally for flash, PSRAM, antenna and power. A development board then adds USB-UART, LEDs, buttons and regulators. Before wiring, record the exact board revision and open its schematic plus the corresponding Espressif datasheet.
Classic ESP32 GPIO Quick Reference
| GPIO group | Practical use | Important warning |
|---|---|---|
| GPIO0, 2, 5, 12, 15 | General I/O after boot | Strapping pins; external levels can alter boot configuration |
| GPIO1, 3 | UART0 TX/RX | Often connected to USB-UART and boot logs |
| GPIO6–11 | Usually unavailable | Commonly connected to module SPI flash |
| GPIO12–14, 25–27 | Digital I/O; some ADC2/touch functions | ADC2 analog use can conflict with Wi-Fi |
| GPIO16, 17 | General I/O on many WROOM boards | May be used by PSRAM on some modules |
| GPIO18, 19, 21–23 | Common SPI/I2C/general I/O choices | Verify board peripherals and startup state |
| GPIO25, 26 | General I/O, ADC2 and DAC on classic ESP32 | DAC is family-specific; not universal across ESP32 variants |
| GPIO32, 33 | General I/O, ADC1, touch | Often useful for analog sensing with Wi-Fi |
| GPIO34–39 | ADC1/digital input | Input-only; no internal output drive, and pull availability is limited |
This is a screening table, not a substitute for the exact datasheet. Pins exposed on one board may be absent or occupied on another.
The ESP32 Pinout Traps That Cost Debug Time
Strapping pins can break boot
The ESP32 samples designated strapping pins around reset to select boot and configuration options. A button, relay module or peripheral with a strong pull can override the required state. Symptoms include a board that programs normally when disconnected but refuses to boot in the finished assembly.
Use strapping pins only when the external circuit presents a safe reset-time level. Calculate the combined pull resistance and account for powered and unpowered peripherals. “It becomes an output later” does not protect the boot interval.
ADC2 and Wi-Fi share resources
On the classic ESP32, ADC2 analog conversion is not generally available while Wi-Fi uses the resource. The same pad may still work as digital GPIO; the conflict concerns ADC2 conversion. For continuous sensing in a Wi-Fi product, start with ADC1-capable pins and verify accuracy, attenuation and source impedance on hardware.
GPIO34–39 cannot drive outputs
These pins are useful inputs and ADC1 channels, but they are input-only. Connecting a relay, LED or chip-select and then wondering why digitalWrite() does nothing is a classic failure. External pull resistors may also be needed for switches or open-drain signals.
Flash and PSRAM pins are not spare GPIO
GPIO6–11 are normally tied to external flash inside classic modules. Other module variants may dedicate additional pins to PSRAM. Reusing them can crash execution or prevent startup. The module datasheet outranks a generic online diagram.

Recommended Pin-Assignment Workflow
- Identify the exact ESP32 family, chip/module code and board revision.
- Reserve flash, PSRAM, USB/JTAG and board-connected pins.
- Mark strapping pins and document their required reset levels.
- List each signal's direction, voltage, speed and startup behavior.
- Allocate ADC1 first when Wi-Fi and analog sampling must coexist.
- Place fixed high-speed or analog functions before flexible UART/I2C/PWM signals.
- Check every external pull-up, pull-down and powered-off state.
- Verify the final mapping against firmware definitions and the schematic.
- Test cold boot, reset, programming and brownout with all peripherals connected.
Saveable ESP32 Pinout Checklist
- Exact chip, module and board schematic confirmed
- No GPIO assignment copied from another ESP32 family
- GPIO6–11 excluded on classic flash modules
- GPIO34–39 used only as inputs
- Strapping pins have safe reset-time levels
- UART0 boot/programming signals remain accessible
- ADC2 is not relied on during Wi-Fi operation
- I2C pull-ups connect to 3.3 V, not 5 V
- Relay, motor and LED loads use suitable drivers
- Inductive loads include flyback or appropriate clamping
- External 5 V signals use level shifting or division where appropriate
- EN/reset network follows the reference design
- Programming and recovery test points remain accessible
Power and Electrical Rules
ESP32 GPIO uses the device's 3.3 V domain. Never assume a pin accepts 5 V because a hobby diagram omits a warning. Check input thresholds, absolute maximum ratings and output-current limits in the exact datasheet. A GPIO should control a MOSFET or driver rather than power a relay, motor, long LED strip or other heavy load directly.
Wi-Fi transmission creates current transients. A weak regulator, thin supply path or poor decoupling can cause brownouts that look like software bugs. Keep the 3.3 V path short and low impedance, place required capacitors close to the module, and test at maximum radio activity with attached loads switching.
From Development Board to Custom ESP32 PCB
A working breadboard pinout is only the beginning. On a custom board, place a PCB-antenna module at the board edge and observe its antenna keepout. Avoid copper, traces, components and enclosure metal in the restricted region specified by the module vendor. For an external-antenna design, follow the RF reference layout and controlled-impedance requirements.
The EN circuit, boot circuitry, decoupling, USB-UART or native USB path, ESD protection and programming access all need deliberate design. An early ESP32 PCB engineering review should compare the module datasheet, GPIO matrix, boot pulls, power supply, antenna placement and enclosure together.

During PCB fabrication and assembly support, keep the approved module variant, antenna geometry, regulator components and boot-network values under revision control. Substituting a “similar ESP32 module” may change footprint, pin availability, flash/PSRAM or antenna requirements.
Frequently Asked Questions
Which ESP32 pins are safest for general output?
On many classic ESP32 DevKitC designs, GPIO18, 19, 21–23, 25–27, 32 and 33 are common starting choices. They are not universally free; verify the exact board schematic and peripheral requirements.
Are ESP32 GPIO pins 5 V tolerant?
Do not design them as 5 V tolerant. Use a level shifter, divider or suitable interface circuit based on signal direction and speed.
Can I use GPIO34 as an output?
No on the classic ESP32. GPIO34–39 are input-only and are better suited to sensors, buttons or ADC inputs with appropriate external biasing.
Why does my ESP32 analog reading fail when Wi-Fi starts?
You may be using an ADC2 channel. Move the signal to an ADC1-capable pin where possible and verify the mapping for your exact ESP32 family.
Can I use a strapping pin after boot?
Yes, if the external circuit preserves the required level during reset and tolerates the pin's startup behavior. Test power-up and reset across all peripheral power states.
Conclusion
The best ESP32 pinout is not the diagram with the most colors; it is a documented mapping that survives boot, Wi-Fi, programming and the attached hardware. Identify the exact variant, reserve internal resources, protect strapping levels and verify the physical PCB. Save the checklist and submit the schematic, module code and pin table for a CAM/DFM and ESP32 layout review before production.











