This article helps you to understand the Nodemcu Pinout, how to use that and you will also learn what are pins used to read digital inputs like a button switch and control digital outputs like an LED using a nodemcu board with Arduino IDE.

ESP8266 Nodemcu is a microcontroller board with built-in wifi. NodeMCU comes with an Esp8266 12-E chip comes. That has 17 GPIO pins which Not all the GPIOs are exposed in all development boards. Some of the GPIOs are not recommended to use, and others have very specific functions.

This guide will help you to understand the nodemcu pinout diagram, which pins can be used for input and output functions.

Refer to Complete guide on ESP32 Pinout reference: what GPIO pins do you use?

ESP8266 NodeMCU Pinout Diagram

The Nodemcu pinout diagram is shown below.

We can easily program the ESP8266 using Arduino IDE. So, make sure you have the ESP8266 boards add-on installed before proceeding

Get Started with Arduino IDE and ESP8266-Nodemcu

NodeMCU pinout Peripherals

The NodeMCU peripherals include

  • 17 General purpose input output pins
  • SPI
  • I2C
  • UART
  • 10-bit ADC

What are the pins used in NODEMCU ESP8266

GPIO number doesn’t match with the label on the pinout diagram. For example, D1 corresponds to GPIO5 and D2 corresponds to GPIO5

Pins that are ready to use as input/output without any problem

  • GPIO5 labeled as D1 often used as SCL (I2C)
  • GPIO4 labeled as D2 often used as SDA (I2C)
  • GPIO0 labeled as D3 connected to FLASH button, boot fails if pulled LOW
  • GPIO2 labeled as D4 connected to on-board LED, boot fails if pulled LOW – HIGH at Boot time
  • GPIO14 labeled as D5 SPI (SCLK)
  • GPIO12 labeled as D6 SPI (MISO)
  • GPIO13 labeled as D7 SPI (MOSI)
  • ADO labeled as AO

Below are the pins OK to use, but you need to pay attention because they may have unexpected behavior mainly at boot.

  • GPIO16 labeled as D0 HIGH at boot used to wake up from deep sleep
  • GPIO15 labeled as D8 Pulled to GND : Boot fails if we pulled HIGH
  • GPIO3 labeled as RX HIGH at boo
  • GPIO1 labeled as TX debug output at boot, boot fails if pulled LOW
NOTE : Pins labeled as RX and ADO are recommended to use as outputs and TX pin not recommend to use as input

Pins referred to as GPIO6 to GPIO11 are connected to the flash chip in ESP8266. So, these pins are not recommended to use as input/output functions.

GPIO4 and GPIO5 are the most safe to use GPIOs if you want to operate relays

On-board LED

NodeMCU has two build-in LEDs and we can use them for testing purposes.LED is usually connected to GPIO2 and GPIO16


These LED works on inverted logic, If you send a HIGH signal to turn it off, and a LOW signal to turn it on



When we set the RST pin is low, the ESP8266 resets. This is the same as pressing the onboard RESET button on nodemcu

If you’re getting started with the ESP8266, we have some great content you might be interested in:

Get Started with Arduino IDE and ESP8266-Nodemcu

Getting Started with ESP8266 WiFi Based Microcontroller