Skip to main content
Application icons are essential for giving your Electron app a professional appearance across all platforms. electron-builder automatically handles icon generation and conversion for different platforms.

Icon File Location

All icon files should be placed in your buildResources directory, which defaults to build/.

macOS Icons

Icon Formats

macOS supports multiple icon formats. electron-builder uses them in the following priority:
  1. .icon (preferred) - Apple Icon Composer asset
  2. .icns (legacy) - Traditional macOS icon format
  3. .png (fallback) - Will be converted to .icns
file
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+
file
Legacy macOS icon formatIf you set mac.icon to .icns, it is copied into the app bundle and referenced via CFBundleIconFile.Minimum size: 512x512 pixels
file
Universal 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

If you only provide .icon format, consider setting dmg.icon explicitly to an .icns file, as the DMG volume icon still requires .icns format.

DMG Background Images

file
Background image for macOS DMG installer.Place in the buildResources directory (defaults to build/).Recommended size: 540x380 pixels
file
Retina (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.
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.
file
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:
  1. The macOS .icns file
  2. Or the common icon.png file
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 in build/icons/ directory with size-specific filenames:
Recommended sizes: 16, 32, 48, 64, 128, 256, 512 (or just 512)

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

Design Guidelines

  1. Use vector source - Start with a vector (SVG, AI) for best quality at all sizes
  2. Square canvas - Use a square canvas with equal width and height
  3. Add padding - Leave ~10% padding around the icon for better appearance
  4. Test all sizes - Verify your icon looks good at small sizes (16x16, 32x32)
  5. Transparent background - Use transparent backgrounds for PNG sources
  6. High resolution - Start with at least 1024x1024 for best results

Common Issues

Icon appears blurry or pixelated
  • Source image is too small
  • Use higher resolution source (1024x1024 minimum)
Wrong icon appears
  • Icon file not in buildResources directory
  • Cached icon from previous build
  • Try clearing the build directory
DMG icon not showing
  • DMG requires .icns format
  • If using .icon, set dmg.icon explicitly to .icns

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:
electron-builder will automatically:
  • Convert to .icns for macOS
  • Convert to .ico for Windows
  • Generate multiple sizes for Linux

Default Icon Behavior

If no icon is provided, the default Electron icon will be used, which is not suitable for production applications.
Icon resolution order:
  1. Platform-specific icon (mac.icon, win.icon, linux.icon)
  2. icon.icns (macOS), icon.ico (Windows), icon.png (Linux)
  3. icon.png (converted to platform format)
  4. Default Electron icon (not recommended)

Platform-Specific Icon Configuration

Advanced Icon Options

Setting Icon to null

You can set icon options to null 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

  1. Clear the build cache:
  2. On macOS, clear the icon cache:
  3. On Windows, rebuild the icon cache:

Verifying Icon Installation

macOS:
Windows:
Linux:

Additional Resources