Favicon Generator

Favicon Generator API

Web Development

Make a favicon from an image, text or an emoji and download favicon.ico, every PNG size, the Apple touch icon, a web manifest and the HTML tags.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

20 requests per minute

Endpoints

1 endpoint available

Overview

Makes a favicon from an uploaded image (a logo, PNG, JPEG or SVG) or from 1 to 3 characters of text, on a coloured or transparent square, rounded square or circle. It uses the same drawing code as the web page and returns the full package as a ZIP, just favicon.ico, or a single PNG.

Outputs

  • zip (default): favicon.ico (16, 32 and 48 px), favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png (180 px, transparency filled with white), android-chrome-192x192.png, android-chrome-512x512.png, site.webmanifest and favicon-html.txt with the <link> tags.
  • ico: just favicon.ico (image/x-icon) with 16, 32 and 48 px images.
  • png: one PNG at size px (16-1024).

Limits and behavior

  • Send multipart/form-data. For an image icon, put the image in the file field (JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB). For a text icon, leave file out and send text. Send one or the other.
  • Text is drawn in Liberation Sans. The web page uses your device's system font, so letter shapes can differ slightly. Emoji icons are only available on the web page.
  • Booleans are the strings true or false. Colours are hex, #rgb or #rrggbb.
  • Errors are JSON: {"success": false, "error": "..."}. Uploads are not stored.

Endpoints

POST
https://opentools.ca/api/v1/tools/favicon-generator
Generate a favicon package, .ico or PNG from an image or text

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
file
file
OptionalImage to make the icon from (JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB). Required unless text is sent.
text
string
Optional1 to 3 characters for a text icon, e.g. "OT". Required unless file is sent.
output
string
Enum: zip, ico, png
OptionalWhat to return. See Outputs.Default: zip
size
number
OptionalPixel size for output=png, 16-1024. Ignored otherwise.Default: 512
background
string
OptionalHex background colour, or "transparent".Default: #2563eb
shape
string
Enum: square, rounded, circle
OptionalIcon shape. Outside a rounded square or circle is transparent.Default: rounded
padding
number
OptionalEmpty space around the image or text, as a fraction of the icon size, 0-0.35.Default: 0.08
fit
string
Enum: contain, cover
OptionalImage icons: contain fits the whole image, cover fills the space and crops.Default: contain
textColor
string
OptionalText icons: hex text colour.Default: #ffffff
bold
boolean
OptionalText icons: bold text.Default: true
scale
number
OptionalText icons: text size as a fraction of the space inside the padding, 0.4-1.Default: 0.85
siteName
string
OptionalSite name for site.webmanifest (up to 60 characters). Empty means "My website".Default: ""
themeColor
string
OptionalHex theme colour for site.webmanifest and the theme-color meta tag.Default: #2563eb

Response Example

The body is the file: a ZIP (Content-Type: application/zip, favicon.zip), an ICO (image/x-icon, favicon.ico) or a PNG (image/png, favicon-<size>x<size>.png). Errors return JSON, for example:
{
  "success": false,
  "error": "Upload an image in the \"file\" field, or send \"text\" (1 to 3 characters)."
}

Error Codes

400
Bad Request - Neither or both of file and text, an invalid option, or an image that could not be read
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key inactive, expired, or not allowed from this IP
413
Payload Too Large - The file is over 20 MB
415
Unsupported Media Type - The file is not a supported image type
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

# Full package from a logo
curl -X POST https://opentools.ca/api/v1/tools/favicon-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@logo.svg" \
  -F "background=transparent" \
  -F "siteName=My Site" \
  -o favicon.zip

# Just favicon.ico from text
curl -X POST https://opentools.ca/api/v1/tools/favicon-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=OT" \
  -F "background=#2563eb" \
  -F "shape=circle" \
  -F "output=ico" \
  -o favicon.ico

Ready to get started?

Create an API key to start using the Favicon Generator API.

Rather use it in your browser? Open the Favicon Generator