SD card module: initialization failed on Arduino or ESP32

Format the card as FAT32, check the chip-select pin in your code, and check the module is powered from the voltage it expects.

What the message means

The library talks to the card over SPI. A card in the wrong format, a wrong CS pin or a weak supply all give the same failure message.

Fix it in this order

  1. Format the card as FAT32. Large cards in other formats are not read by basic libraries.
  2. Check the CS pin number in SD.begin(pin) against your wiring.
  3. Wire SCK, MOSI and MISO to the SPI pins of your board, not to random pins.
  4. Check the supply the module needs. Many cheap modules want 5 V for the card regulator.
  5. Try another card, preferably a smaller and older one.
  6. Keep the wires short, and add a delay after power-up before calling begin.

If you see this, do this

You seeDo this
Works with one card onlyCard format or card quality.
Fails on every cardWiring or power.

Uno power limit, serial monitor shows nothing.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.