ESP32 MAC addresses
Every interface MAC is computed from one base MAC that Espressif programs into eFuse. The rule depends on how many universally administered addresses the chip is configured for.
In short
- The base MAC is pre-programmed by Espressif in eFuse; all interface MACs are calculated from it.1
- ESP-IDF default on most chips (4 universal MACs): Wi-Fi station = base, SoftAP = +1, Bluetooth = +2, Ethernet = +3 on the last byte. arduino-esp32 3.3.12 builds ESP32-S3 with 2 universal MACs instead.1
- With 2 universal MACs on a chip with Bluetooth (ESP32, S3, C2, C3, C5, C6, C61): station = base, Bluetooth = +1; SoftAP and Ethernet get locally administered addresses. On ESP32-S2 the two universal MACs are station and SoftAP (+1), and only Ethernet is local.1
- ESP32-S2 defaults to 2 (station, SoftAP), ESP32-H2 to 2 (802.15.4, Bluetooth), ESP32-P4 to 1 (Ethernet).2
esp_read_mac(mac, ESP_MAC_WIFI_STA)computes the address from the base MAC, so Wi-Fi does not have to be started.WiFi.macAddress()in Arduino needs the station interface to exist (WiFi.mode(WIFI_STA)).1
Universal MAC addresses per chip
CONFIG_<CHIP>_UNIVERSAL_MAC_ADDRESSES sets how many interfaces get a universally administered address. The Default column is the ESP-IDF default; the arduino-esp32 3.3.12 libraries build ESP32-S3 with Two (see its row).
| Chip | Default | Options | Universal MACs go to |
|---|---|---|---|
| ESP32 | 43 | two or four3 | Wi-Fi STA, SoftAP, BT, Ethernet3 |
| ESP32-S2 | 22 | one or two2 | Wi-Fi STA, SoftAP2 |
| ESP32-S3 | 4 (Arduino 3.3.12: 2)4 | two or four4 | Four: Wi-Fi STA, SoftAP, BT, Ethernet. Two (Arduino 3.3.12): Wi-Fi STA, BT4 |
| ESP32-C2 | 45 | two or four5 | Wi-Fi STA, SoftAP, BT, Ethernet5 |
| ESP32-C3 | 46 | two or four6 | Wi-Fi STA, SoftAP, BT, Ethernet6 |
| ESP32-C5 | 47 | two or four7 | Wi-Fi STA, SoftAP, BT, Ethernet, 802.15.47 |
| ESP32-C6 | 48 | two or four8 | Wi-Fi STA, SoftAP, BT, Ethernet, 802.15.48 |
| ESP32-C61 | 49 | two or four9 | Wi-Fi STA, SoftAP, BT, Ethernet9 |
| ESP32-H2 | 210 | fixed10 | 802.15.4, BT10 |
| ESP32-P4 | 111 | fixed11 | Ethernet11 |
Chips without an Ethernet MAC can still compute an Ethernet address for an external (e.g. SPI) Ethernet controller. ESP32-S3 in Arduino: the lib-builder config sets Two; the sdkconfig shipped with the arduino-esp32 3.3.12 esp32s3 libraries (CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=2) was used as a cross-check.
Derivation rule
| Interface | 4 universal (default) | 2 universal (chips with Bluetooth) |
|---|---|---|
| Wi-Fi station | base | base1 |
| Wi-Fi SoftAP | base +1 | local, from station MAC1 |
| Bluetooth | base +2 | base +11 |
| Ethernet | base +3 | local, from Bluetooth MAC1 |
| IEEE 802.15.4 (C5, C6, H2) | EUI-64: base[0..2] + MAC_EXT (2 bytes from eFuse; FF:FE in the source comment) + base[3..5] | same12 |
ESP32-S2 with Two (its default): SoftAP is base +1 as in the 4-universal column, Ethernet is local from base +1. The 2-universal column is what arduino-esp32 3.3.12 uses on ESP32-S3.
Interface MACs from a base MAC
Enter the base MAC (esptool read-mac prints it, or Network.macAddress() in Arduino). The offset is added to the last byte only. Local addresses set bit 0x02 of the first byte (or flip 0x04 if it was already set).
Reading MACs in code
esp_read_mac()
Returns the MAC of one interface, computed from the base MAC: ESP_MAC_WIFI_STA, ESP_MAC_WIFI_SOFTAP, ESP_MAC_BT, ESP_MAC_ETH, ESP_MAC_IEEE802154 (8 bytes). Available in Arduino through esp_mac.h.1
WiFi.macAddress()
Reads the address from the station network interface, which WiFi.mode(WIFI_STA) sets up. Before that the function gets no address and the String version prints 00:00:00:00:00:00.13
Network.macAddress()
Returns the base MAC (esp_base_mac_addr_get), not the address of a particular interface.14
ESP.getEfuseMac()
Copies the factory MAC bytes into a uint64_t. The CPU is little-endian, so MAC byte 0 ends up in the lowest byte: printing the number in hex shows the address reversed.15
#include <WiFi.h>
#include "esp_mac.h"
void printMac(const char *name, const uint8_t *m) {
Serial.printf("%s %02X:%02X:%02X:%02X:%02X:%02X\n", name, m[0], m[1], m[2], m[3], m[4], m[5]);
}
void setup() {
Serial.begin(115200);
uint8_t mac[6];
esp_read_mac(mac, ESP_MAC_WIFI_STA); // works before WiFi is started
printMac("STA ", mac);
esp_read_mac(mac, ESP_MAC_WIFI_SOFTAP);
printMac("AP ", mac);
uint64_t e = ESP.getEfuseMac(); // MAC byte 0 is the LOW byte of e
for (int i = 0; i < 6; i++) mac[i] = (uint8_t)(e >> (8 * i));
printMac("eFuse", mac);
Serial.println(Network.macAddress()); // base MAC
WiFi.mode(WIFI_STA); // creates the station interface
Serial.println(WiFi.macAddress());
}
void loop() {}
Pitfalls
No carry into byte 4
The offset is added to the last byte only (mac[5] is a uint8_t), so a base MAC ending in FF gives a SoftAP MAC ending in 00 with the other bytes unchanged.12
ESP32-S2 SoftAP range fix
Some ESP32-S2 chips were burned with one MAC by mistake; for base MACs in 7C:DF:A1:00:30:00…7C:DF:A1:00:5F:FF the SoftAP MAC is moved to a reserved range instead of +1.12
Custom base MAC: set it first
esp_base_mac_addr_set() (or esp_iface_mac_addr_set() with ESP_MAC_BASE) must be called before any network interface is initialized and before esp_read_mac() is called. The base MAC must be unicast.1
Local addresses
A locally administered address has bit 0x02 set in the first byte; if the source address already had it, bit 0x04 is flipped. Such addresses are meant for a single local network.1
See also
- Flash offsets and esptool commands
- USB serial chips and USB IDs
- Arduino API pitfalls on ESP32
- ESP32 chip families: compare and choose
Sources
Each number links here; open “What it confirms” for the exact quotes. Checked 2026-11-28.
- ESP-IDF v5.5.5 docs (ESP32-S3): misc_system_api primary
What it confirms (13)
- ESP32 MAC addresses: in short “In ESP-IDF, the MAC addresses for the various network interfaces are calculated from a single base MAC address. … The default base MAC is pre-programmed by Espressif in eFuse BLK1.”
- ESP32 MAC addresses: in short “MAC Address (4 universally administered, default) … base_mac, +1 to the last octet … base_mac, +2 to the last octet … base_mac, +3 to the last octet … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP32 MAC addresses: in short “MAC Address (2 universally administered) … Local MAC (derived from Wi-Fi Station MAC) … Local MAC (derived from Bluetooth MAC) … config ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … base_mac_addr[5] += 1; esp_derive_local_mac(mac, base_mac_addr);”
- ESP32 MAC addresses: in short “This function first get base MAC address using esp_base_mac_addr_get(). Then calculates the MAC address of the specific interface requested … if (!mac || _esp_netif == NULL || _interface_id == ESP_NETIF_ID_PPP) {”
- ESP32 MAC addresses: Wi-Fi station “Wi-Fi Station | base_mac | base_mac”
- ESP32 MAC addresses: Wi-Fi SoftAP “Wi-Fi SoftAP | base_mac, +1 to the last octet | Local MAC (derived from Wi-Fi Station MAC)”
- ESP32 MAC addresses: Bluetooth “Bluetooth | base_mac, +2 to the last octet | base_mac, +1 to the last octet”
- ESP32 MAC addresses: Ethernet “Ethernet | base_mac, +3 to the last octet | Local MAC (derived from Bluetooth MAC)”
- ESP32 MAC addresses: Wi-Fi station “Wi-Fi Station … case ESP_MAC_WIFI_STA: memcpy(mac, base_mac_addr, 6); break;”
- ESP32 MAC addresses: Wi-Fi SoftAP (4 universal MACs, or ESP32-S2) “base_mac, +1 to the last octet … mac[5] += 1;”
- ESP32 MAC addresses: esp_read_mac() “To fetch the MAC address for a specific network interface (e.g., Wi-Fi, Bluetooth, Ethernet), call the function esp_read_mac(). … ESP_MAC_IEEE802154, /**< if CONFIG_SOC_IEEE802154_SUPPORTED=y, MAC for IEEE802154 (8 bytes) */”
- ESP32 MAC addresses: pitfall: Custom base MAC: set it first “before initializing any network interfaces or calling the esp_read_mac() function. … Base MAC must be a unicast MAC (least significant bit of first byte must be zero).”
- ESP32 MAC addresses: pitfall: Local addresses “The U/L bit (bit value 0x2) is set in the first octet of the universal MAC address, creating a local MAC address. … then the first octet of the local MAC address is XORed with 0x4. … Note that these addresses are intended for use on a single local network only.”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32s2/Kconfig.mac primary
What it confirms (4)
- ESP32 MAC addresses: in short “default ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO … default ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO … default ESP32P4_UNIVERSAL_MAC_ADDRESSES_ONE”
- ESP32 MAC addresses: ESP32-S2 / Default “default ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO”
- ESP32 MAC addresses: ESP32-S2 / Options “bool "One" … bool "Two"”
- ESP32 MAC addresses: ESP32-S2 / Universal MACs go to “config ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32 / Default “default ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32 / Universal MACs go to “config ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32s3/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-S3 / Default “default ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP32 MAC addresses: ESP32-S3 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-S3 / Universal MACs go to “config ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH … config ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32c2/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-C2 / Default “default ESP32C2_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32-C2 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-C2 / Universal MACs go to “config ESP32C2_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32c3/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-C3 / Default “default ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32-C3 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-C3 / Universal MACs go to “config ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32c5/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-C5 / Default “default ESP32C5_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32-C5 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-C5 / Universal MACs go to “config ESP32C5_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH … select ESP_MAC_ADDR_UNIVERSE_IEEE802154”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32c6/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-C6 / Default “default ESP32C6_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32-C6 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-C6 / Universal MACs go to “config ESP32C6_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH … select ESP_MAC_ADDR_UNIVERSE_IEEE802154”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32c61/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-C61 / Default “default ESP32C61_UNIVERSAL_MAC_ADDRESSES_FOUR”
- ESP32 MAC addresses: ESP32-C61 / Options “bool "Two" … bool "Four"”
- ESP32 MAC addresses: ESP32-C61 / Universal MACs go to “config ESP32C61_UNIVERSAL_MAC_ADDRESSES_FOUR … select ESP_MAC_ADDR_UNIVERSE_WIFI_STA … select ESP_MAC_ADDR_UNIVERSE_WIFI_AP … select ESP_MAC_ADDR_UNIVERSE_BT … select ESP_MAC_ADDR_UNIVERSE_ETH”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32h2/Kconfig.mac primary
What it confirms (3)
- ESP32 MAC addresses: ESP32-H2 / Default “default ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO”
- ESP32 MAC addresses: ESP32-H2 / Options “bool "Two"”
- ESP32 MAC addresses: ESP32-H2 / Universal MACs go to “config ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO … select ESP_MAC_ADDR_UNIVERSE_IEEE802154 … select ESP_MAC_ADDR_UNIVERSE_BT”
- ESP-IDF v5.5.5: components/esp_hw_support/port/esp32p4/Kconfig.mac primary
What it confirms (4)
- ESP32 MAC addresses: ESP32-P4 / Default “default ESP32P4_UNIVERSAL_MAC_ADDRESSES_ONE”
- ESP32 MAC addresses: ESP32-P4 / Options “bool "One"”
- ESP32 MAC addresses: ESP32-P4 / Universal MACs go to “config ESP32P4_UNIVERSAL_MAC_ADDRESSES_ONE … select ESP_MAC_ADDR_UNIVERSE_ETH”
- ESP32 MAC addresses: Ethernet (ESP32-P4) “If the number of universal MAC addresses is one, only Ethernet interface receives a universally administered MAC address. It's generated by adding 0 to the base MAC address.”
- ESP-IDF v5.5.5: components/esp_hw_support/mac_addr.c primary
What it confirms (9)
- ESP32 MAC addresses: IEEE 802.15.4 (C5, C6, H2) “// 60:55:f9:ff:fe:f7:2c:a2 … esp_read_mac(&mac[3], ESP_MAC_EFUSE_EXT); … MAC_EXT eFuse which is used as an extender for IEEE802154 MAC (2 bytes) … #define SOC_IEEE802154_SUPPORTED 1”
- ESP32 MAC addresses: Bluetooth (4 universal MACs) “#if CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR #define MAC_ADDR_UNIVERSE_BT_OFFSET 2 … mac[5] += MAC_ADDR_UNIVERSE_BT_OFFSET;”
- ESP32 MAC addresses: Ethernet (4 universal MACs) “mac[5] += 3;”
- ESP32 MAC addresses: Wi-Fi SoftAP, 2 universal MACs (incl. ESP32-S3 in Arduino 3.3.12) “#else esp_derive_local_mac(mac, base_mac_addr); #endif // CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP … Local MAC (derived from Wi-Fi Station MAC) … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP32 MAC addresses: Bluetooth, 2 universal MACs (incl. ESP32-S3 in Arduino 3.3.12) “#else #define MAC_ADDR_UNIVERSE_BT_OFFSET 1 … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP32 MAC addresses: Ethernet, 2 universal MACs (incl. ESP32-S3 in Arduino 3.3.12, ESP32-S2) “base_mac_addr[5] += 1; esp_derive_local_mac(mac, base_mac_addr); … Local MAC (derived from Bluetooth MAC) … default ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO … CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO=y”
- ESP32 MAC addresses: Bluetooth (ESP32-H2) “// If the chips do not have wifi module, the mac address do not need to add the BT offset”
- ESP32 MAC addresses: pitfall: No carry into byte 4 “esp_err_t esp_read_mac(uint8_t *mac, esp_mac_type_t type) … mac[5] += 1;”
- ESP32 MAC addresses: pitfall: ESP32-S2 SoftAP range fix “// as a result of some esp32s2 chips burned with one MAC address by mistake, … // related mistake MAC address is 0x7cdfa1003000~0x7cdfa1005fff, … // reserved MAC address is 0x7cdfa1020000~0x7cdfa1022fff (MAC address + 0x1d000).”
- arduino-esp32 3.3.12: libraries/WiFi/src/WiFiSTA.h primary
What it confirms (1)
- ESP32 MAC addresses: WiFi.macAddress() “class STAClass : public NetworkInterface { … esp_err_t err = esp_netif_get_mac(_esp_netif, mac); … uint8_t mac[6] = {0, 0, 0, 0, 0, 0}; … WiFi.STA.onEnable(); … _esp_netif = get_esp_interface_netif(ESP_IF_WIFI_STA);”
- arduino-esp32 3.3.12: libraries/Network/src/NetworkManager.cpp primary
What it confirms (1)
- ESP32 MAC addresses: Network.macAddress() “uint8_t *NetworkManager::macAddress(uint8_t *mac) { … esp_base_mac_addr_get(mac);”
- arduino-esp32 3.3.12: cores/esp32/Esp.cpp primary
What it confirms (1)
- ESP32 MAC addresses: ESP.getEfuseMac() “esp_efuse_mac_get_default((uint8_t *)(&_chipmacid)); … Both data bus and instruction bus are little-endian.”