Skip to content
MCUs

ESP32 Flash Size Calculator

Visualise how the ESP32 flash is split across the bootloader, partition table, NVS, OTA, SPIFFS/LittleFS, and app partitions. Helps you choose the right partition scheme for your firmware size.

Estimate a flash partition budget in MiB. Enter the sizes from your actual partition table; defaults are illustrative, not an ESP32 preset.

Estimated reserved

3.574 MiB

Unallocated

0.426 MiB

This is an arithmetic budget only; align it with a valid partition table.

Partition sizes and offsets must follow the ESP-IDF/Arduino framework’s valid alignment and partition-table rules. Confirm the real layout before flashing; a budget estimate does not generate a valid partition CSV.

How ESP32 flash is divided

The ESP32 stores everything in external SPI flash, split into partitions described by a partition table at offset 0x8000:

RegionTypical sizePurpose
Bootloader~28 KB at 0x1000Starts the chip
Partition table4 KB at 0x8000Map of the rest
NVS20–24 KBPreferences, Wi-Fi credentials
otadata8 KBWhich OTA slot to boot
app0 / app11.2–6.5 MB eachYour firmware (two slots for OTA updates)
SPIFFS / LittleFS / FATRemaining spaceFiles, web pages, logs
coredump64 KB (optional)Crash dumps

Arduino IDE partition schemes (4 MB flash)

SchemeApp size (each)OTAFilesystem
Default 4MB with spiffs1.25 MBYes1.4 MB
Minimal SPIFFS1.9 MBYes190 KB
Huge APP3 MBNo896 KB
No OTA (2MB APP/2MB SPIFFS)2 MBNo2 MB

Fixing "Sketch too big"

A sketch using Wi-Fi, Bluetooth and TLS easily passes 1.3 MB, overflowing the default 1.25 MB app slot. Options:

  1. Tools → Partition Scheme → Minimal SPIFFS if you still need OTA updates.
  2. Huge APP if you don't need OTA.
  3. A board with 8 MB or 16 MB flash (ESP32-S3 boards commonly have 8–16 MB) and a matching scheme.
  4. Disable Bluetooth if unused; it adds several hundred kilobytes.

Checking your chip's flash size

Run esptool.py flash_id or look at the module marking: ESP32-WROOM-32E modules come in 4, 8 and 16 MB variants. The ESP32-C3 SuperMini and most XIAO boards have 4 MB.

Formula, inputs and worked examples

Formula and method

Available app space depends on the selected partition table and reserved bootloader, partition table, NVS, OTA/data partitions; calculate from the actual layout rather than a universal fixed formula.

Worked examples

Default Arduino layout on 4 MB

Two 1.25 MB app slots, 1.4 MB SPIFFS and 20 KB NVS fill about 3.9 MB, leaving essentially nothing spare.

Web server with OTA

A 1.6 MB sketch with a 150 KB web UI fits the Minimal SPIFFS scheme: 1.9 MB per app slot and 190 KB for files.

ESP32-S3 with 16 MB

Two 3 MB app slots for OTA still leave about 9.9 MB for a LittleFS image holding audio files or logs.

Inputs

  • Physical flash capacity — Unit: MiB
  • Bootloader and partition table reserves — Unit: MiB
  • NVS and filesystem sizes — Unit: MiB
  • Application slot size and count — Unit: MiB and count

What the result means

  • Total allocated/reserved — Unit: MiB
  • Remaining or over-budget amount — Unit: MiB

Practical tips and common mistakes

  • Partition sizes must be multiples of 4 KB, and app partitions must start on a 64 KB boundary.
  • Keep at least 10–20 % of each app slot free so future updates still fit.
  • Changing the partition table erases existing filesystem data; back it up first.

Assumptions and limitations

  • Read the selected partition CSV or board configuration before relying on a displayed estimate.
  • OTA layouts commonly reserve space for multiple app slots; changing the layout can erase data and affect update behavior.
  • Leave room for filesystem, NVS, and future firmware growth.

Frequently asked questions

How much flash does an ESP32 have?

Most ESP32 dev boards have 4 MB. ESP32-S3 boards commonly have 8 MB or 16 MB, and some modules up to 32 MB. The chip itself has no internal flash except a few variants (ESP32-PICO, some C3/S3 'FN' parts).

How do I fix 'Sketch too big' on ESP32?

Choose a partition scheme with a bigger app slot in Tools → Partition Scheme: Minimal SPIFFS (1.9 MB with OTA) or Huge APP (3 MB without OTA).

Why does OTA need two app partitions?

The new firmware is written to the inactive slot while the old one keeps running. Only after it is verified does the bootloader switch, so a failed update can't brick the device.

Should I use SPIFFS or LittleFS?

LittleFS. SPIFFS is deprecated, slower, and lacks real directories. Both use the same 'spiffs' partition type in the table.

Learn more

More MCUs