A 16 MiB chip is not 16 MiB of usable program space
A flash device’s headline capacity describes the silicon, not the layout a firmware framework exposes. An ESP8266 module can carry 16 MiB (16,777,216 bytes) of SPI flash while the application still sees a far smaller file system, or none at all. Three separate layers decide what is reachable: the chip itself, the ROM/SDK and core-level flash map, and the host tool that writes and reads the image.
The original article behind this page reported a hardware swap on a Wemos D1 mini. Its author described replacing the stock flash device with a Winbond W25Q128FVSIG and then reading the chip identity with esptool. That account is useful as a dated record of what one person observed with 2016-era tooling. It is not a rework procedure, it is not repeated here, and it does not establish what any current core or tool supports.
What Arduino core 3.1.2 documents for a 16 MBytes chip
The ESP8266 Arduino core 3.1.2 filesystem documentation describes one flash chip shared by several regions: the sketch, an OTA update area, the file system, EEPROM, and WiFi configuration. The same document states that "Even though file system is stored on the same flash chip as the program, programming new sketch will not modify file system contents." Programming an application therefore does not by itself wipe stored files, which is why the file system can hold configuration, sketch data, or web content across reflashes.
Usable file system size is not fixed by the chip alone. The documentation says "File system size depends on the flash chip size" and presents a table of options selected by board in the IDE. For a 16 MBytes device the row reads "Any 16MBytes 14MB(OTA), 15MB(MAX)": 14 MB of file system when the layout keeps room for OTA updates, 15 MB in the maximum-file-system configuration, which gives up OTA. Those are documented layout options in that core revision, not a guarantee that a particular board definition, build, or boot path behaves identically.
Mapping can also be deferred to the sketch at boot. The core documents an option called "Mapping defined by Hardware and Sketch", enabled with -DFLASH_MAP_SUPPORT=1, which "allows a sketch, not the user, to select FS configuration at boot according to flash chip size." The three configurations are FLASH_MAP_OTA_FS, FLASH_MAP_MAX_FS, and FLASH_MAP_NO_FS. The same page deprecates the older file system: "SPIFFS is currently deprecated and may be removed in future releases of the core," with LittleFS presented as the actively developed replacement that supports real directories.
Chip identity: capacity codes and simple arithmetic
esptool exposes a flash-id command for reading SPI flash identity. The retrieved esptool basic-commands documentation shows the sample block "Example output: Manufacturer : e0 Device : 4016 Detected flash size : 4 MB". That block is documentation sample text, not a capture from any board discussed here, and the manufacturer byte in it differs from the one in the original article.
The original article reported two readings of its own: an unmodified D1 mini returning "Device: 4016" and the modified board returning "Device: 4018", with the argument that "The low order byte actually indicates the size – so 0x16 or 0x18." That decoding is a vendor-specific example for the Winbond parts involved. It is not a universal rule, and the same two bytes are not guaranteed to carry a size exponent in every manufacturer’s identification scheme.
The arithmetic behind the example is a calculation, not a measurement. A 128 Mbit device holds 128 x 1024 x 1024 bits; dividing by 8 gives 16,777,216 bytes, which is 16 MiB. Reading the low capacity byte as a power-of-two exponent gives 0x18 = 24 and 2^24 = 16,777,216 bytes, while 0x16 = 22 and 2^22 = 4,194,304 bytes. The article also stated that "The 128 in the part number is the size – 128Mbits, 16MBytes." These derivations explain the reported numbers. They say nothing about whether a given firmware stack will address the upper 12 MiB, and a derivation is not an operating guarantee for real hardware.
What esptool documents, and what it does not promise
The esptool basic-commands page was retrieved as an unpinned "latest" snapshot. No retrieval date was recorded, and the snapshot is not a statement about the tool’s current version or about ESP8266 support in any particular release. Within that snapshot, write-flash takes offset and file pairs: "The next arguments to write-flash are one or more pairs of offset (address) and file name." A –flash-size argument exists to override the image, though the page notes that since esptool v2.0 "these options are not often needed as the default is to keep the flash mode and size from the .bin image file."
Erasure granularity is documented as 4096 bytes. All affected sectors must be erased first because they are "the smallest erasable unit", and erase-region addresses and lengths must be multiples of the SPI erase sector size, "0x1000 (4096) bytes for supported flash chips." read-flash takes an address, a size, and an output path, and "It is also possible to autodetect flash size by using ALL as size." These passages describe command syntax and documented behavior. None of them asserts that every ESP8266 ROM path, SDK version, or image header can address a 16 MiB device.
The older above-4 MiB observation, kept in context
The original write-up reported that host tools struggled beyond 4 MiB, noting that "Some fail obviously, some fail silently." Its author attributed the difficulty to ESP8266 SPI flash functions and ROM-level access rather than to the chip’s physical capacity. That is a first-hand observation about specific software of its period and should be read that way: a dated report of a tooling gap, not a standing claim about later cores, SDKs, or esptool revisions. The core 3.1.2 documentation shows that a core can define 16 MBytes layouts, but documentation of available layout options does not prove that a given board, bootloader path, or OTA arrangement will use the whole chip.
An evidence-based evaluation sequence
For a specific board, the defensible order is to confirm the physical part and its reported identity, then confirm which core revision and flash map the build actually selects, then confirm what the host tool writes and what it can read back. A chip identity reading establishes the device; a core table establishes available layout options; neither establishes the other. Any inherited claim that 16 MiB simply works should be treated as a hypothesis until the selected layout, the image header, and a read-back agree.
Related material on this site covers adjacent host-tool and Arduino workflows: AVRDUDESS, a GUI for AVRDUDE, and an Arduino light-meter build using a BH1750FVI sensor. Neither page addresses ESP8266 flash mapping, capacity decoding, or OTA layout.





