Skip to content

ESP32 MAC Address Is Different After Reset

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 MAC Address Is Different After Reset. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 MAC address changes after reset or is different from the label on the module.

Quick Fix

Wrong

Serial.println(WiFi.macAddress());
MAC: 7C:9E:BD:45:12:78
(after reset)
MAC: 7C:9E:BD:45:12:79
#include <WiFi.h>
#include <esp_mac.h>
void setup() {
  uint8_t mac[6];
  esp_efuse_mac_get_default(mac);
  Serial.printf("Base MAC: %02X:%02X:%02X:%02X:%02X:%02X
",
    mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
  WiFi.mode(WIFI_STA);
  Serial.printf("Station MAC: %s
", WiFi.macAddress().c_str());
}
Base MAC: 7C:9E:BD:45:12:78
Station MAC: 7C:9E:BD:45:12:78

Prevention

Use esp_efuse_mac_get_default() to read the factory MAC. Always use the base MAC for device identity. Station and SoftAP MACs differ by +1 and +2 from base. Custom MAC addresses must be set before WiFi.mode(). Burn custom MACs to efuse for persistence.

DodaTech engineers apply these same patterns when building Doda Browser's networking stack, DodaZIP's firmware packaging pipeline, and Durga Antivirus Pro's sensor communication layer.

FAQ

### Why does station and AP MAC differ?

The ESP32 has multiple MAC addresses: base MAC (efuse), station MAC (= base), softAP MAC (= base + 1), and BLE MAC (= base + 2). Each interface needs a unique MAC.

Can I change the ESP32 MAC address?

Yes. Call esp_base_mac_addr_set(new_mac) before WiFi.mode(). This changes the MAC for the current boot only. For permanent changes, burn efuse.

Is the ESP32 MAC address unique worldwide?

Each ESP32 has a unique 48-bit MAC burned in efuse during manufacturing. The first 3 bytes identify Espressif as the manufacturer.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro