# svg-to-ico

> Utility that translates an SVG Image to a .ico format

Latest version **2.0.0** (published 2026-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install svg-to-ico
pnpm add svg-to-ico
yarn add svg-to-ico
bun add svg-to-ico
```

Provides the command `svg-to-ico`.

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-06-16 |
| First published | 2021-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 42.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | jtrauntvein@gmail.com |
| Maintainers | jhtrauntvein |
| Keywords | svg, icon, image, convert |

## Links

- npm: https://www.npmjs.com/package/svg-to-ico
- Repository: https://github.com/jtrauntvein/svg-to-ico
- Homepage: https://github.com/jtrauntvein/svg-to-ico.git/svg-to-ico#readme
- Issues: https://github.com/jtrauntvein/svg-to-ico/issues
- npm.io page: https://npm.io/package/svg-to-ico

## Dependencies (3)

- [xml-js](https://npm.io/package/xml-js.md) ^1.6.11
- [ico-endec](https://npm.io/package/ico-endec.md) ^0.1.6
- [@resvg/resvg-js](https://npm.io/package/@resvg/resvg-js.md) ^2.6.2

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-06-16
- 1.1.1 — 2026-03-19
- 1.1.0 — 2026-03-04
- 1.0.17 — 2025-05-30
- 1.0.16 — 2025-05-05
- 1.0.15 — 2024-07-06
- 1.0.14 — 2023-07-27
- 1.0.13 — 2023-07-22
- 1.0.12 — 2023-02-10
- 1.0.11 — 2022-08-26
- 1.0.10 — 2021-08-31
- 1.0.9 — 2021-08-30
- 1.0.8 — 2021-08-30
- 1.0.7 — 2021-06-24
- 1.0.6 — 2021-06-11
- … 5 more at https://npm.io/package/svg-to-ico/versions

## README

# svg-to-ico .ico file generator
This utility can be used to convert a provided SVG file first into a collection of .PNG files
and then it will combine these into an .ico format (such as is used by favicon.ico).

## CLI Interface
The easiest way to run the utility is to install it globally:

```
npm install -g svg-to-ico
```

Once installed, the utility can be run as follows:

```
svg-to-ico input-file-name [ output-file-name ]
```

If the output file name is not specified, it will default to "favicon.ico" in the current working directory.

## API

To use the API, you can install the package either globally or locally.  The package exposes  a single
async function that accepts the following named parameters:

- input_name (string): Specifies the name of the input SVG file
- output_name (string): Optionally specifies the name of the output .ico file.  If not specified,
   this will default to "favicon.ico" in the current working directory.
- sizes (number[]): Optionally specifies a list of sizes for individual PNG files in the ICO format.  Each size 
   will apply to both the width and the height but the aspect ratio of the original SVG will be preserved.

### Example

```
const svg_to_ico = require("svg-to-ico");

svg_to_ico({
   input_name: "koala.svg",
   output_name: "koala.ico",
   sizes: [ 16, 24, 32, 64 ]
}).then(() => {
   console.log("file converted");
}).catch((error) => {
   console.error(`file conversion failed: ${error});
})
```

---
_Source: https://npm.io/package/svg-to-ico · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
