March 2, 2023

ESP32 Pinout Guide: Everything You Need to Know

ESP32 Board with its pinout label and diagram, each pin label and function on different colors

ESP32 is a dual-core SoC with two powerful Xtensa LX6 CPUs that run at up to 240 MHz. It comes with integrated Wi-Fi and Bluetooth connectivity, making it suitable for a wide range of IoT applications that require wireless connectivity. ESP32 is the successor of the popular ESP8266 chip, and it offers a lot more capabilities and functionality.

ESP32 also includes various peripherals such as SPI, I2C, UART, ADC, DAC, PWM, and GPIO, which makes it highly adaptable and suitable for a wide range of projects ranging from low-power sensor networks to the most demanding tasks, such as voice encoding, music streaming and MP3 decoding.

One of the ESP32’s major advantages is its support for low-power operation, including deep-sleep modes for battery-powered designs. Power requirements depend on whether you are using the bare chip, a module, or a development board: the ESP32 itself uses 3.3 V logic, while many DevKit boards can accept 5 V through USB or a regulated input.

Does ESP32 have digital pins?

Yes. The classic ESP32 chip provides 34 physical GPIOs, although a specific module or development board exposes fewer usable pins. GPIO34–GPIO39 are input-only, and GPIO6–GPIO11 are normally reserved for the integrated flash on ESP32-WROOM-32 boards. Always check the pinout for your exact board before assigning digital inputs or outputs.

ESP32 Pinout

  • 18 Analog-to-Digital Converter (ADC) channels
  • 3 SPI interfaces
  • 3 UART interfaces
  • 2 I2C interfaces
  • 16 PWM output channels
  • 2 Digital-to-Analog Converters (DAC)
  • 2 I2S interfaces
  • 10 Capacitive sensing GPIOs

NOTE: This guide focuses on the classic ESP32 used in ESP32-WROOM-32 modules and common ESP32 DevKit V1 boards. Not every chip pin is exposed on every board, and newer families such as ESP32-S2, ESP32-S3, ESP32-C3, and ESP32-C6 use different pinouts. On common ESP32-WROOM-32 boards, GPIO6–GPIO11 are connected to SPI flash and should not be used for general I/O.

Is ESP32 3.3 or 5V?

The ESP32 is a 3.3V device, which means that all of its input and output pins are designed to operate with a maximum voltage of 3.3 volts. Connecting the ESP32 to a voltage source greater than 3.3 volts can damage the device, so it's important to use level shifters or voltage dividers when interfacing with higher voltage devices. Our voltage divider calculator sizes R2 for a 5V to 3.3V drop once you pick R1, and gives you the nearest standard E-series value.

The ESP32 chip and its GPIO use 3.3 V logic, and the official GPIO tolerance limit is 3.6 V. Many development boards include a regulator and can accept 5 V from USB or a 5 V/VIN pin, but that does not make the GPIO pins 5 V tolerant. Check the specifications for your exact board and use level shifting when a connected device outputs 5 V logic.

What are GPIO in ESP32?

GPIO Input Output Practical note
GPIO0 Yes Yes Boot strapping pin; LOW enters the serial bootloader
GPIO1 Yes Yes UART0 TX; commonly used for programming and logs
GPIO2 Yes Yes Boot strapping pin; board use varies
GPIO3 Yes Yes UART0 RX; commonly used for programming
GPIO4 Yes Yes Also ADC2 and touch capable
GPIO5 Yes Yes Boot strapping pin; commonly used as VSPI CS
GPIO6–11 Reserved Reserved Normally connected to SPI flash; do not use on ESP32-WROOM-32 boards
GPIO12 Yes Yes Boot strapping pin; an incorrect level can prevent boot
GPIO13 Yes Yes General-purpose; also ADC2 and touch capable
GPIO14 Yes Yes General-purpose; also ADC2 and touch capable
GPIO15 Yes Yes Boot strapping pin; also ADC2 and touch capable
GPIO16 Yes Yes May be reserved for PSRAM on some modules
GPIO17 Yes Yes May be reserved for PSRAM on some modules
GPIO18 Yes Yes Common VSPI clock pin
GPIO19 Yes Yes Common VSPI MISO pin
GPIO21 Yes Yes Default I2C SDA in many Arduino examples
GPIO22 Yes Yes Default I2C SCL in many Arduino examples
GPIO23 Yes Yes Common VSPI MOSI pin
GPIO25 Yes Yes DAC1 output; also ADC2
GPIO26 Yes Yes DAC2 output; also ADC2
GPIO27 Yes Yes General-purpose; also ADC2 and touch capable
GPIO32 Yes Yes ADC1, touch, and RTC capable
GPIO33 Yes Yes ADC1, touch, and RTC capable
GPIO34 Yes No Input-only; no internal pull-up or pull-down
GPIO35 Yes No Input-only; no internal pull-up or pull-down
GPIO36 Yes No Input-only; no internal pull-up or pull-down
GPIO39 Yes No Input-only; no internal pull-up or pull-down

Input Only GPIO Pins

  • GPIO 34
  • GPIO 35
  • GPIO 36
  • GPIO 39

These pins don’t have internal pull-up or pull-down resistors. They can’t be used as outputs, so use these pins only as inputs:

ESP32 GPIO Pins with Internal Pull Resistors

Most digital GPIOs on the classic ESP32 can enable weak internal pull-up or pull-down resistors in software. However, GPIO34–GPIO39 do not provide internal pulls, and pins connected to flash, PSRAM, or boot-strapping functions still require extra care. Internal pulls are useful for defined logic states, but an external resistor is often preferable for noise-sensitive or safety-critical inputs.

ESP32 GPIO Pins Without Internal Pull Resistors

  • GPIO34
  • GPIO35
  • GPIO36
  • GPIO39

These input-only pins do not have software-controlled pull-up or pull-down resistors. Add an external resistor when the input must not float.

To utilize these pins in Arduino IDE,  and you want to make GPIO 22 as input and GPIO 23 as output:

pinMode(22,INPUT_PULLUP);
pinMode(23,OUTPUT);
digitalWrite(23,HIGH);

What is pinMode()?

pinMode() configures the specified pin to behave either as an input (with or without an internal weak pull-up or pull-down resistor), or an output. It is possible to enable the internal pullup resistors with the mode INPUT_PULLUP. Additionally, the INPUT mode explicitly disables the internal pullups.

ESP32 Serial

The classic ESP32 includes three hardware UART controllers—UART0, UART1, and UART2—and their signals use 3.3 V logic. The GPIO matrix allows UART signals to be remapped, which is important because UART0 is commonly used for programming and logs, while UART1’s default signals overlap flash pins on many modules.

UART Common RX Common TX Practical note
UART0 GPIO3 GPIO1 Typically used for USB-to-serial programming and logs
UART1 Remappable Remappable Default signals overlap flash pins on common modules, so remap them
UART2 GPIO16 GPIO17 Common defaults; check for PSRAM reservations on the selected module

ESP32 Strapping Pins

Strapping pin Boot consideration
GPIO0 LOW during reset enters the serial bootloader
GPIO2 Boot strapping pin; avoid forcing an incompatible level at reset
GPIO5 Boot strapping pin; keep attached circuits from overriding the required level
GPIO12 Must not be pulled HIGH on common 3.3 V flash modules
GPIO15 Boot strapping pin; avoid external circuitry that changes its reset level

The classic ESP32 samples GPIO0, GPIO2, GPIO5, GPIO12, and GPIO15 during reset to select boot and hardware configuration options. Development boards usually manage the required states automatically, but external peripherals can still prevent boot or flashing if they drive a strapping pin to the wrong level at reset.

Why some ESP32 pins are default HIGH during Boot?

Some GPIOs change their state to HIGH or output PWM signals at boot or reset. This means that if you have outputs connected to these GPIOs you may get unexpected results when the ESP32 resets or boots.

  • GPIO 1
  • GPIO 3
  • GPIO 5
  • GPIO 6 to GPIO 11 (connected to the ESP32 integrated SPI flash memory – not recommended to use).
  • GPIO 14
  • GPIO 15

NOTE: If you have peripherals connected to these pins, you may encounter issues with trying to upload new code, flashing the ESP32 with new firmware, or resetting the board, it may be because those peripherals are preventing the ESP32 from entering the right mode.

How many I2C pins ESP32 has?

The ESP32 has two I2C channels and any pin can be set as SDA or SCL. When using the ESP32 with the Arduino IDE, the default I2C pins are:

  • GPIO 21 (SDA)
  • GPIO 22 (SCL)

You can use the wire library to use other pins for I2C, you just need to call:

Wire.begin(SDA, SCL);

What are the SPI pins of ESP32?

These are the default pin mapping for SPI

SPI MOSI MISO CLK CS
VSPI GPIO23 GPIO19 GPIO18 GPIO5
HSPI GPIO13 GPIO12 GPIO14 GPIO15

GPIO 6 to GPIO 11 are exposed in some ESP32 development boards. However, these pins are connected to the integrated SPI flash on the ESP-WROOM-32 chip and are not recommended for other uses. So, don’t use these pins in your projects:

  • GPIO 6 (SCK/CLK)
  • GPIO 7 (SDO/SD0)
  • GPIO 8 (SDI/SD1)
  • GPIO 9 (SHD/SD2)
  • GPIO 10 (SWP/SD3)
  • GPIO 11 (CSC/CMD)

Does ESP32 have Interrupts Pins?

All usable ESP32 GPIO inputs can be configured to trigger interrupts. In the Arduino core, attachInterrupt() associates an input pin with an interrupt service routine and a trigger condition such as RISING, FALLING, or CHANGE. Reserved flash pins should not be repurposed, and GPIO34–GPIO39 remain input-only.

attachInterrupt(GPIO_pin, ISR, Event);

What is Enable pin (EN) on ESP32?

EN is the ESP32 chip-enable and reset input—not the development board regulator’s enable pin. It is normally pulled HIGH. Pulling EN LOW resets and disables the chip, which is why many boards connect it to a RESET or EN pushbutton.

ESP32 Analog to Digital Converter ADC Input Pins

The ESP32 has built-in Analog to Digital Converters (ADC) that allow it to convert analog signals into digital values that can be processed by the digital circuits on the chip. The ESP32 has a total of 18 ADC channels, which can be used to read analog signals from various sensors, such as temperature sensors, light sensors, and other types of sensors that output analog signals.

The ESP32's ADC has a resolution of 12 bits, which means that it can measure the analog signal and convert it into a digital value between 0 and 4095. The ADC can also be configured to sample the analog signal at different rates and can be programmed to read multiple channels simultaneously.

The ESP32 has 18 x 12 bits ADC input channels (while the ESP8266 only has 1x 10 bits ADC). These are the GPIOs that can be used as ADC and respective channels: 

  • ADC1_CH0 (GPIO 36)
  • ADC1_CH1 (GPIO 37)
  • ADC1_CH2 (GPIO 38)
  • ADC1_CH3 (GPIO 39)
  • ADC1_CH4 (GPIO 32)
  • ADC1_CH5 (GPIO 33)
  • ADC1_CH6 (GPIO 34)
  • ADC1_CH7 (GPIO 35)
  • ADC2_CH0 (GPIO 4)
  • ADC2_CH1 (GPIO 0)
  • ADC2_CH2 (GPIO 2)
  • ADC2_CH3 (GPIO 15)
  • ADC2_CH4 (GPIO 13)
  • ADC2_CH5 (GPIO 12)
  • ADC2_CH6 (GPIO 14)
  • ADC2_CH7 (GPIO 27)
  • ADC2_CH8 (GPIO 25)
  • ADC2_CH9 (GPIO 26)

Important: ADC2 channels cannot be used normally while Wi-Fi is active because ADC2 is shared with the Wi-Fi subsystem. Also, GPIO37 and GPIO38 exist on the chip but are not exposed on common ESP32-WROOM-32 modules, so confirm the pins available on your exact board.

ESP32 Digital-to-Analog Converter (DAC) Output Pins

There are 2 x 8 bits DAC channels on the ESP32 to convert digital signals into analog voltage signal outputs. These are the DAC channels:

  • DAC1 (GPIO25)
  • DAC2 (GPIO26)

ESP32 Capacitive Touch Sensor Sensitive GPIOs

The ESP32 has 10 capacitive touch GPIOs. These GPIOs can sense variations in anything that holds an electrical charge, like the human skin. So they can detect variations induced when touching the GPIOs with a finger.

These pins can be easily integrated into capacitive pads, and replace mechanical buttons. Additionally, the touch pins can also be used as a wake up source when the ESP32 is in deep sleep.

  • T0 (GPIO 4)
  • T1 (GPIO 0)
  • T2 (GPIO 2)
  • T3 (GPIO 15)
  • T4 (GPIO 13)
  • T5 (GPIO 12)
  • T6 (GPIO 14)
  • T7 (GPIO 27)
  • T8 (GPIO 33)
  • T9 (GPIO 32)

To use the ESP32 touch sensor in Arduino:

Reading the touch sensor is straightforward. You use the touchRead() function, that accepts as argument, the GPIO you want to read.

touchRead(GPIO);

This example arduino sketch reads the touch pin 0 and displays the results in the Serial Monitor.

// ESP32 Touch Test
// Just test touch pin - Touch0 is T0 which is on GPIO 4
void setup() {  
Serial.begin(115200);
// give me time to bring up serial monitor  
delay(1000); 
Serial.println("ESP32 Touch Test");
}

void loop() {  
// get value of Touch 0 pin = GPIO 4
Serial.println(touchRead(4));  
delay(1000);
}

ESP32 RTC GPIOs

There is RTC GPIO support on the ESP32. The GPIOs routed to the RTC low-power subsystem can be used when the ESP32 is in deep sleep. These RTC GPIOs can be used to wake up the ESP32 from deep sleep when the Ultra Low Power (ULP) co-processor is running. The following GPIOs can be used as an external wake up source.

  • RTC_GPIO0 (GPIO36)
  • RTC_GPIO3 (GPIO39)
  • RTC_GPIO4 (GPIO34)
  • RTC_GPIO5 (GPIO35)
  • RTC_GPIO6 (GPIO25)
  • RTC_GPIO7 (GPIO26)
  • RTC_GPIO8 (GPIO33)
  • RTC_GPIO9 (GPIO32)
  • RTC_GPIO10 (GPIO4)
  • RTC_GPIO11 (GPIO0)
  • RTC_GPIO12 (GPIO2)
  • RTC_GPIO13 (GPIO15)
  • RTC_GPIO14 (GPIO13)
  • RTC_GPIO15 (GPIO12)
  • RTC_GPIO16 (GPIO14)
  • RTC_GPIO17 (GPIO27)

ESP32 PWM pins

The classic ESP32 LED Control (LEDC) peripheral provides up to 16 PWM channels. PWM is not limited to a fixed set of “PWM pins”: the GPIO matrix can route an LEDC channel to most output-capable GPIOs. Avoid GPIO34–GPIO39 because they are input-only, and avoid flash, PSRAM, or boot-sensitive pins unless your board design accounts for their other functions.

Choose the PWM frequency and duty-cycle resolution together because higher resolution reduces the maximum practical frequency. Arduino-ESP32 PWM APIs have changed between core versions, so use the LEDC functions documented for the version installed in your project rather than relying on an old fixed-pin table.

ledcSetup();
ledcAttachPin();


Check out ESP32 Datasheet

Profile avatar of the blog author

Jharwin Barrozo

Jharwin is an electronics engineer mainly focused on satellites. He built his own ground station using Flux to monitor RF activities on the International Space Station. Find him on Flux @jharwinbarrozo

Go 10x faster from idea to PCB
Work with Flux like an AI hardware engineer—handling complex tasks, learning your standards, explaining its decisions, and collaborating with you at every step.
Illustration of sub-layout. Several groups of parts and traces hover above a layout.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.

Related Content

STM32: Things You Need to Know

STM32: Things You Need to Know

Learn about STM32 microcontrollers, popular series, USB OTG, SWD, UART, and development tools. Find the right STM32 MCU and kickstart your projects.

Profile avatar of Jharwin Barrozo
Jharwin Barrozo
|October 3, 2024
ESP8266 Pinout Guide: Complete GPIO Reference & IoT Project Tips

ESP8266 Pinout Guide: Complete GPIO Reference & IoT Project Tips

Looking for a comprehensive guide to ESP8266 pinout? Check out our article that covers everything you need to know about the ESP8266's pins, including digital, analog, and PWM pins. Perfect for beginners and experts alike, our guide will help you understand the ESP8266's pinout and how to use it in your projects.

Profile avatar of Jharwin Barrozo
Jharwin Barrozo
|November 3, 2023
Raspberry Pi Zero 2 W Review: a Powerful and Affordable Mini Computer

Raspberry Pi Zero 2 W Review: a Powerful and Affordable Mini Computer

The Raspberry Pi Zero 2 W is a small and powerful computer with impressive performance for its size and price. With a quad-core processor, 512MB of RAM, built-in wireless connectivity, and a USB On-The-Go port, it's suitable for many projects, including home automation, media centers, and robotics.

Profile avatar of Jharwin Barrozo
Jharwin Barrozo
|February 25, 2023
Raspberry Pi Pinouts: A Comprehensive Guide

Raspberry Pi Pinouts: A Comprehensive Guide

In this article, we will provide a comprehensive guide to the Raspberry Pi pinout diagram, including a description of each pin and its functions.

Profile avatar of Lance Cassidy
Lance Cassidy
|February 4, 2023
Amps vs. Volts: Key Differences and How They Work Together

Amps vs. Volts: Key Differences and How They Work Together

Understanding amps and volts is key to working with electronics. This guide explains their roles, relationship, and practical applications.

Profile avatar of Jharwin Barrozo
Jharwin Barrozo
|August 25, 2026
What Is a Multilayer Ceramic Capacitor (MLCC)?

What Is a Multilayer Ceramic Capacitor (MLCC)?

The blog post dives into the technical aspects of Multilayer Ceramic Capacitors (MLCCs), highlighting their importance in electronic circuits. It explains the construction of MLCCs, where layers of ceramic material and metal electrodes create a multilayered structure to store electrical energy.

Profile avatar of Gabriel Hacohen
Gabriel Hacohen
|August 25, 2026
What Is a Zener Diode? How It Works and Where It’s Used

What Is a Zener Diode? How It Works and Where It’s Used

The blog offers an in-depth look at Zener diodes, highlighting their crucial role in voltage regulation and stability in electronic circuits. It covers their basic principles, applications, and the challenges faced in their usage.

Profile avatar of Jake Hertz
Jake Hertz
|August 25, 2026
ESP32 vs Arduino: Key Differences & Which to Choose?

ESP32 vs Arduino: Key Differences & Which to Choose?

Compare ESP32 vs Arduino across performance, Wi-Fi, Bluetooth, memory, power consumption, and use cases. Learn the key differences to choose the right microcontroller for your next project.

Profile avatar of Jake Hertz
Jake Hertz
|August 17, 2026