Tauri has a built-in CLI command that can generate all required icons from your SVG file. Here's how to do it:
Run the following command from your project directory, pointing to your SVG file:12
npm run tauri icon ./path/to/your-icon.svgOr with other package managers:
yarn tauri icon ./your-icon.svg
pnpm tauri icon ./your-icon.svg
cargo tauri icon ./your-icon.svgThe command automatically creates all icons needed for different platforms and places them in src-tauri/icons/ by default:31
- Windows:
icon.ico - macOS:
icon.icns - Linux/General: Multiple PNG sizes (
32x32.png,128x128.png,128x128@2x.png,icon.png) - Mobile: Icons placed directly into Xcode and Android Studio projects1
The generated icons are automatically referenced in your tauri.conf.json under the bundle section:4
"bundle": {
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}- For best results, ensure your SVG has equal width and height (square aspect ratio)5
- If you want icons output to a different directory, use the
-oflag:tauri icon ./icon.svg -o ./custom-folder3 6789101112131415
Use a 1024×1024 pixel square SVG as your source file. The tauri icon command will automatically scale it down to generate all the required sizes (32, 128, 256, 512 pixels, etc.).1617
- Square aspect ratio — width must equal height1816
- RGBA format — include transparency (alpha channel)18
- 32-bit color — 8 bits per channel16
Do NOT add rounded corners to your source icon. Here's the platform-specific guidance:
| Platform | Corner Handling |
|---|---|
| macOS | The system automatically applies rounded corners that match other UI elements 1920 |
| iOS | System applies rounded corner masking automatically 19 |
| Windows | No rounded corners applied — icons are displayed as-is 21 |
| Linux | Varies by desktop environment; typically no automatic rounding |
Provide a full-bleed square image and let each OS handle masking. If you bake in rounded corners, they may look wrong when the OS applies its own rounding on top, or appear inconsistent on Windows/Linux.19
- Keep important content away from the edges (use roughly 80% of the canvas for the main graphic) to account for macOS/iOS corner clipping22
- Ensure good contrast on both light and dark backgrounds22
- Avoid small text or fine details — icons are often displayed at 32px or smaller23
- Apple provides official icon templates at Apple Design Resources if you want to preview how your icon will look with system masking24 252627282930
Footnotes
-
https://favicon.im/blog/favicon-electron-tauri-desktop-app-branding ↩
-
https://stackoverflow.com/questions/72476337/how-to-create-icons-with-tauricon ↩
-
https://stackoverflow.com/questions/78324346/is-there-a-correct-way-to-set-the-icons-for-my-tauri-application ↩
-
https://hexmos.com/freedevtools/svg_icons/tauri/tauri-original/ ↩
-
https://iconbuddy.com/material-icon-theme/folder-src-tauri-open ↩
-
https://dev.to/rain9/tauri5-tray-icon-implementation-and-event-handling-5d1e ↩
-
https://developer.apple.com/design/human-interface-guidelines/app-icons ↩ ↩2 ↩3
-
https://learn.microsoft.com/en-us/windows/apps/design/style/iconography/app-icon-construction ↩
-
https://learn.microsoft.com/en-us/windows/apps/design/style/iconography/app-icon-design ↩ ↩2
-
https://blog.icons8.com/articles/choosing-the-right-size-and-format-for-icons/ ↩
-
https://stackoverflow.com/questions/67466848/following-apples-app-icon-guidelines-wont-give-corner-radius-to-macos-app-icon ↩
-
https://favicon.im/blog/favicon-electron-tauri-desktop-app-branding ↩
-
https://www.reddit.com/r/iOSProgramming/comments/1ajqk3i/whats_the_apple_proprietary_corner_radiusratio/ ↩

Create iconset directory
mkdir icon.iconset
Copy/resize your PNG to required sizes
sips -z 16 16 icon_1024.png --out icon.iconset/icon_16x16.png
sips -z 32 32 icon_1024.png --out icon.iconset/icon_16x16@2x.png
sips -z 32 32 icon_1024.png --out icon.iconset/icon_32x32.png
sips -z 64 64 icon_1024.png --out icon.iconset/icon_32x32@2x.png
sips -z 128 128 icon_1024.png --out icon.iconset/icon_128x128.png
sips -z 256 256 icon_1024.png --out icon.iconset/icon_128x128@2x.png
sips -z 256 256 icon_1024.png --out icon.iconset/icon_256x256.png
sips -z 512 512 icon_1024.png --out icon.iconset/icon_256x256@2x.png
sips -z 512 512 icon_1024.png --out icon.iconset/icon_512x512.png
cp icon_1024.png icon.iconset/icon_512x512@2x.png
Generate .icns
iconutil -c icns icon.iconset -o src-tauri/icons/icon.icns
Cleanup
rm -rf icon.iconset