ESP8266 NodeMCU Pinout: D Pins, GPIO & Boot Pins
ESP8266 NodeMCU D-pin labels and GPIO numbers are different naming systems. Identify the exact development board before wiring: a NodeMCU header, a D1 mini header and a bare ESP8266 module are not physically interchangeable. This reference explains the NodeMCU layout; D1 mini owners should also use the LOLIN D1 mini V4 guide.
NodeMCU D-label to GPIO reference
| Board label | ESP8266 GPIO |
|---|---|
| D0 | GPIO16 |
| D1 | GPIO5 |
| D2 | GPIO4 |
| D3 | GPIO0 |
| D4 | GPIO2 |
| D5 | GPIO14 |
| D6 | GPIO12 |
| D7 | GPIO13 |
| D8 | GPIO15 |
These labels follow the NodeMCU definitions in the ESP8266 Arduino core. Match the actual board silkscreen and do not treat header position as a GPIO number.
Before using the pin table
- Read the board silkscreen and match the revision to its schematic.
- Distinguish header labels from GPIO numbers and from library pin definitions.
- Check pins already assigned to onboard devices and boot functions before adding a sensor.

Introduction to the ESP8266 NodeMCU Board
While the ESP8266 is a chip, it's most commonly used on development boards like the NodeMCU. This board integrates the chip, a USB-to-Serial converter, voltage regulator, and GPIO pins into a developer-friendly package that can be programmed easily via Arduino IDE or other platforms. The pinout we discuss refers to this popular board format.
Detailed GPIO Pin Breakdown
It's vital to remember that the ESP8266 chip has more functions than it has physical pins. Therefore, most pins serve multiple purposes (multiplexing). The numbering on the board (like D0, D1) often differs from the internal GPIO number, which you use in your code.
Here is a functional overview of the key pins:
-
Digital I/O Pins (GPIOs): Pins like GPIO0, GPIO2, GPIO4, GPIO5, etc., can be configured as standard digital input or output pins using
pinMode(),digitalRead(), anddigitalWrite()in Arduino code.

-
Analog Input (ADC): A0 is the analog input. The bare ESP8266 ADC input range and the development-board A0 range can differ because some boards add a divider. Check the exact board schematic before applying a voltage; do not assume every A0 header accepts 3.3V.

-
Power Pins:
-
3.3V: The main operating voltage for the board and connected peripherals.
-
Vin (VUSB): Can be used to power the board directly with a 5V supply (e.g., from a USB port).
-
GND: Ground pins.
-

-
Special Function Pins:
-
SPI Pins: GPIO12 (MISO), GPIO13 (MOSI), GPIO14 (SCLK), and GPIO15 (CS) provide hardware SPI communication for interfacing with sensors, displays, and SD cards.
-
-
I2C Pins: While not hardware-defined, I2C functionality can be implemented via software on almost any pin. By convention, GPIO4 (SDA) and GPIO5 (SCL) are typically used.
-
-
UART Pins: GPIO1 (TX) and GPIO3 (RX) are used for serial communication with a computer or other devices.
-

-
Boot-mode pins: GPIO0, GPIO2 and GPIO15 affect boot selection. External circuits must preserve the levels required by the board at startup; check its schematic before using these pins.
-

Critical Operational Considerations
-
3.3V Logic Level: The ESP8266 is not 5V tolerant. Applying 5V to any GPIO pin will likely destroy the chip. Always use logic level converters when interfacing with 5V devices like most Arduino boards.
-
Limited Current Sourcing: Each GPIO pin can safely source a maximum of 12mA (with a combined total of ~60mA for all pins). Always use external drivers (like transistors or MOSFETs) for motors or high-power LEDs.
-
Deep Sleep and Power Saving: To build battery-powered projects, use the deep sleep mode. The
RSTpin can be connected toGPIO16(D0) to allow the chip to wake itself up from deep sleep after a predefined period. -
Pins to Avoid: Some pins are used for boot and flash operations. For example, GPIO6 to GPIO11 are internally used for communicating with the flash memory chip and should not be used for other purposes.
Programming Your ESP8266
The easiest way to program the NodeMCU board is via the Arduino IDE:
-
Install the ESP8266 board package via the Boards Manager.
-
Select "NodeMCU 1.0 (ESP-12E Module)" as your board.
-
Connect the board via USB and select the correct port.
-
Use the GPIO number (e.g.,
16) in your code, not the pin label (e.g.,D0).
Project Ideas to Get Started
-
Wi-Fi Enabled Smart Switch
-
IoT Temperature and Humidity Sensor
-
Wireless Plant Watering System
-
ESP8266 Web Server
By understanding the pin functions and their limitations, you can unlock the powerful capabilities of the ESP8266 and bring your IoT ideas to life reliably.
======================================
Related tutorials and hardware
- LOLIN D1 mini V4: ESP8266 Arduino & Wi-Fi Setup
- USB & upload troubleshooting
- WEMOS D1 Mini V4.0.0 TYPE-C USB WIFI Internet of Things Board based ESP8266 4MB LOLIN 12C MicroPython Nodemcu Arduino Compatible
Sources and version references
Use the pinout with a specific board
The D-pin names belong to board labels, while GPIO numbers identify the chip signals. For an actual first upload, use the D1 mini setup guide or USB upload troubleshooting. Check the physical board revision and onboard A0 circuit before connecting an analog signal.
