Skip to content

Arduino Mega 2560 Pinout

Find the Arduino Mega 2560 pinout, digital and analog pins, memory limits, and Circuitera compile/upload support. Check board-specific library compatibility.

Processor
ATMEGA2560
Clock
16 MHz
Physical flash
262144 bytes
Application flash
253952 bytes
SRAM
8192 bytes
EEPROM
4096 bytes
Digital pins
54
Analog inputs
16
PWM
D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D44, D45, D46
Hardware UARTs
4
UART pins
D0, D1, D14, D15, D16, D17, D18, D19, RX0, TX0, RX1, TX1, RX2, TX2, RX3, TX3
I2C
D20, D21, SDA, SCL
SPI
D50, D51, D52, D53, MISO, MOSI, SCK, SS
External interrupts
D2, D3, D18, D19, D20, D21
Logic voltage
5 V
Bootloader
STK500v2 · Wiring
Protocol / baud
STK500v2 · 115200
Compile capability
Verified · automated compile
Upload capability
Untested · physical hardware
Serial capability
Untested · physical hardware
Simulation
Not supported for this profile
Build-matched compile check
2026-10-25
Arduino Mega 2560 logical UART, I2C, SPI, interrupt, PWM and analog signal groups from the validated pin profile
Logical signal reference; aliases can share a physical terminal. Use the official board pinout for physical placement.

Compile for the larger AVR target

Select Arduino Mega 2560 before Verify. Its 16 MHz ATmega2560 target provides 253,952 bytes of application flash and 8,192 bytes of SRAM, with bootloader space already excluded from the application limit. Build Output uses these Mega limits. Servo, Wire, SPI, EEPROM, and the bundled library compile checks are available for this target; compilation is not a hardware test.

Wire to the Mega pin map

Mega exposes D0–D53 and A0–A15. PWM pins are D2–D13 and D44–D46. I2C uses D20 (SDA) and D21 (SCL); SPI uses D50 (MISO), D51 (MOSI), D52 (SCK), and D53 (SS), also available on the ICSP header. Do not copy Uno A4/A5 I2C wiring onto a Mega. Check the board-aware pin helper before connecting peripherals.

Choose the right serial interface

Serial connects to the board’s USB serial bridge through D0/D1. Serial1 uses RX19/TX18, Serial2 uses RX17/TX16, and Serial3 uses RX15/TX14 for external devices. These extra UARTs do not become separate browser USB ports. Serial Monitor still uses the selected USB connection; use your sketch to relay other UART data if needed.

Upload support and simulation limits

The Mega upload target uses the STK500v2/Wiring bootloader protocol at 115200 baud, with board-specific signature and flash verification. This release has compiler and protocol tests; physical Mega upload has not been verified in the development test environment. Mega 2560 simulation is not supported. Circuitera blocks running this target in the simulator rather than silently simulating an Uno.

Upload and validation limits

Select the actual board and bootloader, use a USB data cable, and grant one port permission. Keep serial pins clear of interfering peripherals.

No physical upload certification recorded in these build reports. Compile capability, simulated protocol tests and physical upload are separate claims.

Toolchain: avr-gcc-wasm@0.2.0. Last matching compile evidence: 2026-10-25. Build: e0f6d304cce4ae0a0989a9b1300cbc1a21a595e5e3e7f57ed0ab3468ecf7940b.

How these results are measured →

Arduino Mega 2560 pinout table

Every pin and alias is present in the initial HTML. Filter by signal capability, or select a pin for its existing reference details. Disconnect power before changing wiring.

90 pin entries

Select a pin to read its capabilities.

PinCapabilitiesDetails
DIGITAL · UARTDigital input/output · RX0 · Serial · shared with USB
DIGITAL · UARTDigital input/output · TX0 · Serial · shared with USB
DIGITAL · PWM · INTERRUPTDigital input/output · PWM with analogWrite()
DIGITAL · PWM · INTERRUPTDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite() · LED_BUILTIN
DIGITAL · UARTDigital input/output · TX3 · Serial3
DIGITAL · UARTDigital input/output · RX3 · Serial3
DIGITAL · UARTDigital input/output · TX2 · Serial2
DIGITAL · UARTDigital input/output · RX2 · Serial2
DIGITAL · UART · INTERRUPTDigital input/output · TX1 · Serial1
DIGITAL · UART · INTERRUPTDigital input/output · RX1 · Serial1
DIGITAL · I2C · INTERRUPTDigital input/output · SDA
DIGITAL · I2C · INTERRUPTDigital input/output · SCL
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITAL · PWMDigital input/output · PWM with analogWrite()
DIGITALDigital input/output
DIGITALDigital input/output
DIGITALDigital input/output
DIGITAL · SPIDigital input/output · MISO
DIGITAL · SPIDigital input/output · MOSI
DIGITAL · SPIDigital input/output · SCK
DIGITAL · SPIDigital input/output · SS
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 54. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 55. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 56. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 57. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 58. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 59. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 60. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 61. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 62. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 63. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 64. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 65. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 66. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 67. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 68. No PWM. A4/A5 are not I²C on Mega.
ANALOG · DIGITAL10-bit analog input (0–1023). Also digital pin 69. No PWM. A4/A5 are not I²C on Mega.
DIGITAL · I2CSDA · same electrical terminal as D20.
DIGITAL · I2CSCL · same electrical terminal as D21.
DIGITAL · SPIMISO · same electrical terminal as D50.
DIGITAL · SPIMOSI · same electrical terminal as D51.
DIGITAL · SPISCK · same electrical terminal as D52.
DIGITAL · SPISS · same electrical terminal as D53.
DIGITAL · UARTRX0 · same electrical terminal as D0. RX0 · Serial · shared with USB
DIGITAL · UARTTX0 · same electrical terminal as D1. TX0 · Serial · shared with USB
DIGITAL · UARTRX1 · same electrical terminal as D19. RX1 · Serial1 Separate TTL UART; not a separate browser USB serial port.
DIGITAL · UARTTX1 · same electrical terminal as D18. TX1 · Serial1 Separate TTL UART; not a separate browser USB serial port.
DIGITAL · UARTRX2 · same electrical terminal as D17. RX2 · Serial2 Separate TTL UART; not a separate browser USB serial port.
DIGITAL · UARTTX2 · same electrical terminal as D16. TX2 · Serial2 Separate TTL UART; not a separate browser USB serial port.
DIGITAL · UARTRX3 · same electrical terminal as D15. RX3 · Serial3 Separate TTL UART; not a separate browser USB serial port.
DIGITAL · UARTTX3 · same electrical terminal as D14. TX3 · Serial3 Separate TTL UART; not a separate browser USB serial port.
POWER5 V power rail; not a programmable I/O pin.
POWER3.3 V regulated output, up to 50 mA; not a programmable I/O pin.
GROUNDCommon ground reference.
POWERExternal power input before the regulator. Use USB for first projects.
RESETActive-low microcontroller reset.
REFERENCEAnalog reference input. Configure analogReference() appropriately before applying an external reference.
Official Arduino board pinout reference ↗

Library compile results

Actual source/hash-matched results for this exact profile. A passed compile does not prove a real peripheral, motor or wiring works.

LibraryPinned versionResultFlash / static RAMTest date
HID1.0UNSUPPORTEDNot recorded2026-10-25
Keyboard1.0.7UNSUPPORTEDNot recorded2026-10-25
Mouse1.0.1UNSUPPORTEDNot recorded2026-10-25
Servo1.3.0PASS3578 / 161 bytes2026-10-25
Wire1.0PASS5258 / 408 bytes2026-10-25
SPI1.0PASS3460 / 192 bytes2026-10-25
EEPROM2.0PASS2788 / 188 bytes2026-10-25
SoftwareSerial1.0PASS4362 / 301 bytes2026-10-25
LiquidCrystal1.0.7PASS2850 / 59 bytes2026-10-25
DHT1.4.7PASS6362 / 219 bytes2026-10-25
Adafruit Unified Sensor1.1.15PASS10146 / 302 bytes2026-10-25
Adafruit GFX1.12.6PASS11808 / 533 bytes2026-10-25
Adafruit SSD13062.5.17PASS14614 / 399 bytes2026-10-25
Adafruit BusIO1.17.4PASS7914 / 438 bytes2026-10-25
Adafruit NeoPixel1.15.5PASS3880 / 41 bytes2026-10-25
NewPing1.9.7PASS3822 / 209 bytes2026-10-25
IRremote4.7.1PASS13248 / 1075 bytes2026-10-25
Keypad3.1.1PASS4682 / 327 bytes2026-10-25
AccelStepper1.64PASS6864 / 119 bytes2026-10-25
LiquidCrystal_I2C1.1.2PASS4648 / 275 bytes2026-10-25

Projects and next steps

The public tutorials are validated on Uno. Their concepts can help with this board, but wiring, pin maps, libraries and the exact profile must be reviewed and verified separately; they are not claimed as tested projects on this board.

Keep exploring.