Arduino build error

text section exceeds available space in board

The compiled program has to fit in flash memory. An Uno has 32,256 bytes for your sketch. This one needs more.

  • Build error
  • 2 common causes
  • Seen 26 times in failed builds on Mokxi in the 30 days to November 16, 2026.
The message

What the Arduino IDE prints

Output window
Sketch uses 40124 bytes (124%) of program storage space. Maximum is 32256 bytes.
text section exceeds available space in board
Compilation error: text section exceeds available space in board

Large tables, bitmaps, text and heavy libraries are what fill it. Shrink them, or choose a board with more flash.

Mokxi's linker says the firmware does not fit in the board's flash, and by how many bytes.

Causes

The 2 usual causes with the fix

1A table or an image is bigger than the flash

A constant table stored with PROGMEM sits in flash. A very large one fills it alone. Keep fewer values, or compress them.

Broken
#include <avr/pgmspace.h>

const uint8_t table[40000] PROGMEM = {1, 2, 3};

void setup() {
  Serial.begin(9600);
  Serial.println(pgm_read_byte(&table[1]));
}

void loop() {
}
Fixed
#include <avr/pgmspace.h>

const uint8_t table[4000] PROGMEM = {1, 2, 3};

void setup() {
  Serial.begin(9600);
  Serial.println(pgm_read_byte(&table[1]));
}

void loop() {
}

Mokxi’s build tab says: The program is bigger than the 32 KB of flash this board has

Try this fix in Mokxi

2The board is too small for the project

The Arduino Mega 2560 has 253,952 bytes of flash for a sketch, eight times the Uno. The same table fits there without a change.

Broken
#include <avr/pgmspace.h>

const uint8_t table[40000] PROGMEM = {1, 2, 3};

void setup() {
  Serial.begin(9600);
  Serial.println(pgm_read_byte(&table[1]));
}

void loop() {
}
Fixed
#include <avr/pgmspace.h>

const uint8_t table[40000] PROGMEM = {1, 2, 3};

void setup() {
  Serial.begin(9600);
  Serial.println(pgm_read_byte(&table[1]));
}

void loop() {
}

Mokxi’s build tab says: The program is bigger than the 32 KB of flash this board has

Try this fix in Mokxi

FAQ

Questions and answers

How much flash does an Uno have?

The ATmega328P has 32 KB. The bootloader takes about 0.5 KB, which leaves 32,256 bytes for your sketch.

Does a bigger sketch run slower?

No. Size and speed are separate. Only the amount of flash matters for this error.

What fills flash the fastest?

Fonts, bitmaps, big tables and libraries such as displays. Check what the largest libraries in the sketch cost before cutting code.