VS Code extension for converting web files into C/C++ header arrays for Arduino ESP8266 / ESP32 firmware.
The extension converts files such as html, css, js, images, or any other asset into a .h file that can be embedded directly into firmware and served by an HTTP server running on the device.
The idea is based on the article
https://tinkerman.cat/post/embed-your-website-in-your-esp8266-firmware-image/
Installation
Install from the Visual Studio Code Marketplace:
https://marketplace.visualstudio.com/items?itemName=dzanis.esp-html-to-header
or open Extensions in VS Code and search:
esp-html-to-header
Usage
The extension adds commands that convert files to C header arrays.
Method 1 — Command Palette
Ctrl + Shift + P
Run one of the commands:
ESP HTML: to header
ESP HTML: to gzip-header
ESP HTML: to minify-header
ESP HTML: to minify-gzip-header
Right click a file in the Explorer:
ESP HTML →
to header
to gzip-header
to minify-header
to minify-gzip-header
The generated .h file will be created next to the source file.
Features
- Convert files into C/C++ byte arrays
- Minify
html, css, js
- Gzip compression support
- Designed for ESP8266 / ESP32 firmware web servers
Example
Input file:
index.html
Generated header:
const uint8_t index_html[] PROGMEM = {
0x3c, 0x68, 0x74, 0x6d ...
};
Usage Example

Extension Settings
The extension contributes the following settings:
espHtmlToHeader.saveMinifiedFile
Save generated minified file (.min.[ext])
Default:
false
espHtmlToHeader.minifyOptions
Configuration passed directly to html-minifier-terser.
Default:
{
"removeComments": true,
"collapseWhitespace": true,
"minifyCSS": { "level": 2 },
"minifyJS": {
"compress": { "passes": 2 },
"mangle": {
"toplevel": true,
"properties": { "keep_quoted": true }
}
}
}
Known Issues
None currently reported.
Release Notes
0.0.1
Initial version