ESP32 Pinout & Power Basics
GPIO numbering, the pins to avoid, and how to power a dev board safely from USB or a battery.
Before wiring anything up, it helps to know which pins are safe to use freely, which have a special job at boot, and which should be left alone. Getting this wrong is one of the most common reasons a first ESP32 project won't upload or behaves strangely.
General-purpose pins
Most GPIO pins can be configured in software as input or output, and many also support PWM, analog input, or a communication bus. That flexibility is convenient, but it also means a handful of pins are reserved for the flash memory chip inside the module and must not be touched.
| Pin group | Typical use | Note |
|---|---|---|
| GPIO 6–11 | Connected internally to flash | Avoid — reserved on most modules |
| GPIO 0, 2 | Boot mode selection | Usually fine after boot, avoid pulling low at power-up |
| GPIO 34–39 | Input-only, analog capable | No internal pull-up/pull-down, no output |
| GPIO 21, 22 | Default I2C (SDA/SCL) | Free to reuse if you're not using I2C |
Power pins
Most dev boards have a 5V-tolerant input pin (often labelled VIN or 5V) for USB or an external supply, plus a 3V3 pin that outputs the board's regulated 3.3 V rail — useful for powering small sensors, but not able to supply much current on its own.