Recommended tools: Icon Composer, AppIcon Generator, MakeAppIcon
Icon File Location
All icon files should be placed in your buildResources directory, which defaults tobuild/.
macOS Icons
Icon Formats
macOS supports multiple icon formats. electron-builder uses them in the following priority:.icon(preferred) - Apple Icon Composer asset.icns(legacy) - Traditional macOS icon format.png(fallback) - Will be converted to.icns
Preferred format for modern macOSIf you set
mac.icon to a .icon file, electron-builder compiles it into an asset catalog (Assets.car) and wires it via CFBundleIconName.Requires Xcode 26+ (
actool 26+) on macOS 15+Legacy macOS icon formatIf you set
mac.icon to .icns, it is copied into the app bundle and referenced via CFBundleIconFile.Minimum size: 512x512 pixelsUniversal fallback formatIf no
.icon or .icns file is provided, electron-builder will use icon.png and convert it to the appropriate format.Minimum size: 512x512 pixels (1024x1024 recommended)DMG Volume Icon
DMG Background Images
Background image for macOS DMG installer.Place in the buildResources directory (defaults to
build/).Recommended size: 540x380 pixelsRetina (HiDPI) background image for macOS DMG installer.Recommended size: 1080x760 pixels (2x the standard background)
Example macOS Configuration
Windows Icons
Icon Format
Windows applications use.ico format, which contains multiple icon sizes in a single file.
Windows application icon. Should contain multiple sizes: 16x16, 32x32, 48x48, 64x64, 128x128, 256x256.Minimum size: 256x256 pixelsIf not provided, electron-builder will convert
icon.png to .ico format.If
icon.ico is not provided, electron-builder will use icon.png and convert it to .ico.Minimum size: 256x256 pixels (512x512 recommended)Icon Configuration
NSIS Installer Icons
You can also customize the NSIS installer icons:Creating ICO Files
You can create.ico files from .png using various tools:
-
ImageMagick:
- Online tools: ConvertICO, ICO Convert
Linux Icons
Icon Generation
Linux icon sets are generated automatically based on:- The macOS
.icnsfile - Or the common
icon.pngfile
electron-builder automatically generates all required Linux icon sizes from your source icon.
Custom Linux Icons
You can provide custom Linux icons by placing them inbuild/icons/ directory with size-specific filenames:
Icon Configuration
AppImage Icons
For AppImage, you can specify a single icon file:Windows AppX Icons
Windows AppX (Microsoft Store) requires a specific set of icons and assets. See AppX Assets documentation for detailed requirements.Required AppX Assets
Icon Best Practices
Size Requirements Summary
| Platform | Format | Minimum Size | Recommended Size |
|---|---|---|---|
| macOS | .icns, .icon, .png | 512x512 | 1024x1024 |
| Windows | .ico, .png | 256x256 | 512x512 |
| Linux | .png | 512x512 | 512x512 |
Design Guidelines
- Use vector source - Start with a vector (SVG, AI) for best quality at all sizes
- Square canvas - Use a square canvas with equal width and height
- Add padding - Leave ~10% padding around the icon for better appearance
- Test all sizes - Verify your icon looks good at small sizes (16x16, 32x32)
- Transparent background - Use transparent backgrounds for PNG sources
- High resolution - Start with at least 1024x1024 for best results
Common Issues
Using a Single PNG Source
For simplicity, you can use a single high-resolution PNG file, and electron-builder will convert it to the appropriate format for each platform:- Convert to
.icnsfor macOS - Convert to
.icofor Windows - Generate multiple sizes for Linux
Default Icon Behavior
Icon resolution order:- Platform-specific icon (
mac.icon,win.icon,linux.icon) icon.icns(macOS),icon.ico(Windows),icon.png(Linux)icon.png(converted to platform format)- Default Electron icon (not recommended)
Platform-Specific Icon Configuration
Advanced Icon Options
Setting Icon to null
You can set icon options tonull to explicitly use default behavior:
File Associations Icons
You can specify icons for file associations:Protocol Icons
For macOS protocol schemes:Troubleshooting
Icon not updating
-
Clear the build cache:
-
On macOS, clear the icon cache:
-
On Windows, rebuild the icon cache: