esp32.diy

ESP32 Pinout Explained: Pins, Labels, Limits and Gotchas

Nov 23, 2026 · 9 min read · Beginner

ESP32 Pinout Explained: Pins, Labels, Limits and Gotchas
TL;DR An ESP32 pinout is the map between the labels printed on a specific development board and the GPIO numbers the chip actually uses in code, so the right diagram depends on your exact board (DevKit V1, ESP32-S3 Super Mini, ESP32-C3 Mini, Arduino Nano ESP32, and so on). In Arduino code you address pins by GPIO number, and on boards like the Arduino Nano ESP32 the printed label and the code number can differ, which is the most common pinout trap.
What a pinout mapsBoard header labels to chip GPIO numbers used in code
Arduino pin numberingGPIO number, e.g. pinMode(34, INPUT) on a classic ESP32 dev board
Label vs code mismatch exampleArduino Nano ESP32: physical D6 is pin 9 in code
Interrupt handler requirementMark the ISR with IRAM_ATTR and keep it to a few instructions
Official Nano ESP32 pinoutdocs.arduino.cc/hardware/nano-esp32
ESP32-S3 peripheral blocks32 blocks, each with a page in the esp-labs-web datasheet atlas

What does an ESP32 pinout actually show?

When people search for an ESP32 pinout, they usually want a picture of their dev board with every header pin labelled, so they know which physical pin to wire a sensor or LED to and which number to type into code. The key thing to understand is that there are two layers here:

Layer What it describes Where you see it
Chip pins The GPIO numbers of the ESP32 silicon and the peripheral jobs each one can take (ADC, SPI, I2C, and so on) Espressif datasheets and technical reference
Board pins How a particular dev board routes those GPIOs to its headers and what it prints next to them The board's pinout diagram or vendor docs

Code almost always talks to the first layer, while your fingers and jumper wires deal with the second. A pinout diagram is simply the bridge between them. That is also why there is no single universal ESP32 pinout: a classic ESP32 DevKit V1, an ESP32-S3 Super Mini, an ESP32-C3 Mini and an Arduino Nano ESP32 each have their own header layout and their own chip variant, so each needs its own diagram.

The sources for this guide do not include a full pin-by-pin table with voltages or current limits, so this article does not invent one. Instead it focuses on how to read a pinout correctly, how to translate it into working code, and the mistakes that trip people up most often.

Arduino Nano ESP32 board, front side with header labels\2

Arduino Nano ESP32 board, front side with header labels

Which ESP32 pinout diagram matches my board?

Before wiring anything, identify the board family and grab the diagram for that exact board. The following boards appear in the sources and images for this guide:

Board Chip family Where to find the pinout
ESP32 DevKit V1 Classic ESP32 Community pinout diagram (Wikimedia Commons, Rev 12)
ESP32-S3 Super Mini ESP32-S3 Community pinout diagram (Wikimedia Commons)
ESP32-C3 Mini ESP32-C3 Community pinout diagram (Wikimedia Commons)
Arduino Nano ESP32 ESP32-S3 Official Arduino docs at docs.arduino.cc/hardware/nano-esp32, including pinout diagrams
ESP32-S3 DevKitC-1 ESP32-S3 Interactive pinout and 3D board at esp-labs-web.vercel.app

A few practical rules when choosing a diagram:

If you are working with an ESP32-S3 DevKitC-1, the esp-labs-web project offers a live pinout where each lab highlights the pins it uses, plus a datasheet section where you can pick an individual pin such as GPIO0 and see its jobs with a citation back to Espressif's reference.

Arduino Nano ESP32 board, back side\2

Arduino Nano ESP32 board, back side

ESP32 Arduino pinout: why the number in code differs from the label

In the Arduino framework for ESP32 you reference pins by GPIO number. On a classic ESP32 dev board, writing pinMode(34, INPUT) means GPIO 34, and that is also what the silkscreen typically says, so the mapping feels one-to-one.

The Arduino Nano ESP32 shows why you cannot assume that everywhere. One maker who could not find the board in the Arduino IDE's ESP32 package uploaded with a generic ESP32-S3 preset and discovered, by testing pins one at a time, that the physical pin labelled D6 responded as pin 9 in code. Nano-style boards print Arduino-style D-numbers on the header, while the generic preset exposes raw GPIO numbers, so the two do not line up.

Situation What the label means What the code number means
Classic ESP32 dev board GPIO number printed on silkscreen Same GPIO number
Arduino Nano ESP32 with generic ESP32-S3 preset Arduino D-label (e.g. D6) Underlying GPIO (D6 was 9 in the reported case)

Takeaways for an ESP32 Arduino pinout:

  1. Select the correct board in the IDE whenever it is available. The board definition is what makes labels like D6 resolve correctly.
  2. If you must use a generic preset, open the official pinout for your board and read the GPIO column, not the D-label column.
  3. When behaviour does not match the diagram, verify the pin with a quick test before blaming the hardware. Finding the mismatch by toggling pins one by one is tedious but reliable.

The esp-labs-web code reader is a handy way to see this in real firmware: it opens the actual code each lab flashes and explains it line by line, so you can see which GPIO constants are used and how they relate to the live pinout.

ESP32-S3 Super Mini pinout diagram\2

ESP32-S3 Super Mini pinout diagram Image: espboards.dev, CC0, via Wikimedia Commons

How do I use an ESP32 pin as an interrupt input in Arduino?

Reading a pinout tells you which pin to wire; using it as an interrupt source adds two rules that are easy to miss. The pattern below, taken from a working ESP32 Arduino example that watched GPIO 34 for a rising edge, is the one to copy:

#define SS 34

void IRAM_ATTR enableSend() {
    // set a flag here, do the real work in loop()
}

void setup(){
  pinMode(SS, INPUT);
  attachInterrupt(digitalPinToInterrupt(SS), enableSend, RISING);
}
Rule Why it matters
Put IRAM_ATTR on the handler The ESP32 needs the interrupt service routine placed in internal RAM (IRAM); without it the handler is not reliably callable
Keep the ISR tiny The chip halts normal execution to run the ISR, so it should take only a handful of CPU instructions
No Serial.println() inside the ISR Serial output takes milliseconds, far too long for an interrupt context
Set a flag, act later Change a variable in the ISR and check it in the regular program flow; print or send data from there

The original poster had tried both with and without digitalPinToInterrupt() and with and without IRAM_ATTR, and the version that fails most obviously is the one that tries to print directly from the handler. Treat the pinout as step one and this ISR discipline as step two whenever a pin needs to react to an external signal.

ESP32 DevKit V1 pinout diagram (Rev 12)\2

ESP32 DevKit V1 pinout diagram (Rev 12) Image: Vishnu Maiea, CC BY-SA 4.0, via Wikimedia Commons

Where are pin assignments defined in ESP-IDF and PlatformIO projects?

Outside Arduino, the pinout lives in configuration rather than in #define lines scattered through sketches. Knowing where to look saves a lot of debugging.

Environment Where pins are defined
ESP-IDF with ESP-BSP Board Support Packages ship a pinout definition for a specific board plus helpers that initialise its peripherals and drivers for on-board chips such as displays, sensors and audio codecs
ESP-IDF with ESP-IDF-CXX C++ wrapper classes for GPIO, I2C, SPI and other peripherals, with some error checking moved to compile time
PlatformIO + lvgl_esp32_drivers Display and touch controller pins configured in platformio.ini and the driver settings

A real-world example: a maker wiring an ILI9341 display and XPT2046 touch controller to an ESP32 under ESP-IDF 4.4.2 and LVGL v8.3 had the pins set in platformio.ini, yet still hit a Guru Meditation Error ... LoadProhibited panic. The accepted advice was that the pin wiring was not necessarily the problem; the LVGL v7 port for ESP32 (lv_port_esp32) worked where v8 did not, so the suggestion was to confirm the schematic with v7 first and migrate later. The lesson is that a correct pinout does not guarantee a working display: driver and library versions matter as much as the wires.

If you are starting a board-specific project under ESP-IDF, checking whether an ESP-BSP exists for your board is a quick way to get a known-good pinout without transcribing a diagram by hand.

ESP32 pinout gotchas and safe usage notes

These are the mistakes that come up repeatedly in the sources behind this guide, plus the honest limits of what those sources cover.

On safe electrical limits: the sources used here do not state voltage ratings, maximum pin current, or which pins are input-only, so this guide does not list them. Take those numbers from the Espressif datasheet for your exact chip, or from a tool such as the esp-labs-web reference reader that quotes Espressif's own text.

Where can I read the ESP32-S3 pin and peripheral details without the full datasheet?

Espressif's documents are thorough but heavy. The open-source esp-labs-web project repackages the ESP32-S3 material for makers:

Feature What it gives you
Pin page Every pin and its jobs; pick a pin such as GPIO0 to see what it can do
Peripheral atlas All 32 peripheral blocks, each with its own page (for example the ADC block)
Memory, clocks, power modes Curated summary with citations to the reference sections
Read mode Board guide, module datasheet, chip datasheet and technical reference stitched into one readable book
3D board The ESP32-S3 DevKitC-1 with callouts that light up parts and list the labs using them

Every curated fact cites its section of the Espressif reference, and clicking a citation opens that section in a side reader. The text of the reference itself remains Espressif's; the project just makes it navigable and links it to 32 hands-on labs. Pins and peripheral blocks your labs have touched light up as you tick off steps, which is a nice way to build a mental model of the pinout rather than memorising a diagram. The guide is available in 12 languages and works on a phone, so it doubles as a bench reference.

Frequently asked questions

Why does my Arduino Nano ESP32 pin D6 behave like pin 9 in code?

When the board is not in the Arduino IDE's ESP32 package and you upload with a generic ESP32-S3 preset, the code uses raw GPIO numbers while the header shows Arduino D-labels. One maker found D6 mapped to 9 this way; the official pinout at docs.arduino.cc/hardware/nano-esp32 resolves the mapping.

Why is my ESP32 interrupt function never called in Arduino?

Most often the handler lacks IRAM_ATTR, which places it in internal RAM, or it does too much work such as Serial.println(). Mark the ISR with IRAM_ATTR, keep it to a few instructions, set a flag and act on it in the main loop.

Is there one universal ESP32 pinout diagram?

No. The DevKit V1, ESP32-S3 Super Mini, ESP32-C3 Mini and Arduino Nano ESP32 each have different headers and chip variants, so you need the diagram for your exact board and revision.

Where are pinouts defined in ESP-IDF projects?

ESP-BSP board support packages include the pinout definition and peripheral initialisation helpers for specific boards, and ESP-IDF-CXX offers C++ classes for GPIO, I2C and SPI. In PlatformIO display projects, pins are usually set in platformio.ini.

Does a correct pinout guarantee my display will work?

Not on its own. An ILI9341 setup with correctly configured pins still crashed with a LoadProhibited panic under LVGL v8.3 on ESP-IDF 4.4.2, while the LVGL v7 lv_port_esp32 worked, so library versions matter too.

Bottom line

Treat the ESP32 pinout as a per-board translation table between silkscreen labels and chip GPIO numbers, and always fetch the diagram for your exact board family and revision. In Arduino, code by GPIO number, remember that Nano-style labels can differ from code numbers, and follow the IRAM_ATTR and keep-it-short rules for interrupt pins. For electrical limits, go to Espressif's datasheet or a cited reader like esp-labs-web rather than relying on a bare diagram.

Sources

github.comEspressif's Frameworks (esp-idf docs)stackoverflow.comInterrupts function not called with ESP32 Arduinostackoverflow.comCannot get image in display ILI9341 LVGL v8.3, ESP32electronics.stackexchange.comArduino NANO ESP32 pinoutgithub.comagharsallah/esp-labs-web (GitHub README)

This guide summarises the public sources listed above in our own words. Check the original documentation before relying on exact figures.