Favicon generator API

Turn a PNG, JPEG or SVG logo, or a letter, into a full favicon set: favicon.ico, PNG and maskable icons, apple-touch-icon, site.webmanifest and HTML.

GETPOSThttps://apibox.io.vn/v1/favicon
Images & Codes▶ Try it online

Send a logo as an image (PNG, JPEG or SVG via multipart file, raw body, file_base64 or url), as SVG markup in svg, or just text (1–3 characters, e.g. your initial) with background, color and shape (square, rounded, circle) to draw a letter icon. You get the files a website needs today: favicon.ico with 16, 32 and 48 px images (32-bit BMP inside, read by every browser and Windows), favicon-96x96.png, favicon.svg when the source is vector (sanitised and optimised), apple-touch-icon.png 180 px on an opaque background, android-chrome-192x192.png and -512x512.png, a maskable-icon-512x512.png with the logo inside the 80% safe zone, site.webmanifest, and the <link> / <meta> tags to paste into <head>.

Non-square images are centred (fit=contain) or centre-cropped (fit=cover); padding (percent) adds a margin. SVG sources are drawn at every size by our renderer, so small icons stay sharp. name, short_name, theme_color, background_color, display and the URL path of the files go into the manifest and the HTML.

The JSON response holds every file as a data URI; format=zip returns a ZIP with all files and favicon-snippet.html. Nothing is stored.

Parameters

NameInTypeRequiredDefault
filebodyfilenoLogo (PNG, JPEG or SVG): multipart, raw body or file_base64.
svgbodystringnoSVG markup instead of a file.
urlquery|bodystringnoPublic URL of the logo.
textquery|bodystringnoLetter icon: 1–3 characters (used when no image is sent).
backgroundquery|bodystringno#2563ebLetter icon background colour.
colorquery|bodystringno#ffffffLetter colour.
shapequery|bodystringnoroundedLetter icon shape: square, rounded or circle.
fitquery|bodystringnocontaincontain (centre a non-square image) or cover (centre crop).
paddingquery|bodynumberno0Margin around the logo, percent of the icon size (0–40).
namequery|bodystringnoApp name for the manifest.
short_namequery|bodystringnoShort name (home screen label).
theme_colorquery|bodystringno#ffffffTheme colour (manifest + <meta name="theme-color">).
background_colorquery|bodystringno#ffffffSplash / maskable background colour.
apple_backgroundquery|bodystringnoBackground of apple-touch-icon (default: background_color).
pathquery|bodystringno/URL folder of the files in the HTML and manifest.
formatquery|bodystringnojsonjson (data URIs) or zip.

Example

curl -X POST "https://apibox.io.vn/v1/favicon" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"A","background":"#2563eb","name":"APIBox Demo","short_name":"Demo","theme_color":"#2563eb"}'

Response

{
  "source": "text",
  "html": "<link rel=\"icon\" type=\"image/png\" href=\"/favicon-96x96.png\" sizes=\"96x96\">\n<link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\">\n<link rel=\"shortcut icon\" href=\"/favicon.ico\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\">\n<meta name=\"apple-mobile-web-app-title\" content=\"Demo\">\n<link rel=\"manifest\" href=\"/site.webmanifest\">\n<meta name=\"theme-color\" content=\"#2563eb\">",
  "manifest": {
    "name": "APIBox Demo",
    "short_name": "Demo",
    "icons": [
      {
        "src": "/android-chrome-192x192.png",
        "sizes": "192x192",
        "type": "image/png"
      },
      {
        "src": "/android-chrome-512x512.png",
        "sizes": "512x512",
        "type": "image/png"
      },
      {
        "src": "/maskable-icon-512x512.png",
        "sizes": "512x512",
        "type": "image/png",
        "purpose": "maskable"
      }
    ],
    "theme_color": "#2563eb",
    "background_color": "#ffffff",
    "display": "standalone"
  },
  "files": [
    {
      "name": "favicon.ico",
      "type": "image/x-icon",
      "width": 48,
      "height": 48,
      "bytes": 15086,
      "data_uri": "data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAqBAAAJ4EAAAwMAAAAQAgAKglAABGFQAAKAAAABAAAAAgAAAAAQAgAAA…"
    },
    {
      "name": "favicon-96x96.png",
      "type": "image/png",
      "width": 96,
      "height": 96,
      "bytes": 1573,
      "data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4…"
    },
    {
      "name": "favicon.svg",
      "type": "image/svg+xml",
      "bytes": 289,
      "data_uri": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cmVjdCB3aW…"
    },
    {
      "name": "apple-touch-icon.png",
      "type": "image/png",
      "width": 180,
      "height": 180,
      "bytes": 3125,
      "data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAIAAACyr5Fl…"
    },
    {
      "name": "android-chrome-192x192.png",
      "type": "image/png",
      "width": 192,
      "height": 192,
      "bytes": 3311,
      "data_uri": "data:image/png;base64,…"
    },
    {
      "name": "android-chrome-512x512.png",
      "type": "image/png",
      "width": 512,
      "height": 512,
      "bytes": 10018,
      "data_uri": "data:image/png;base64,…"
    },
    {
      "name": "maskable-icon-512x512.png",
      "type": "image/png",
      "width": 512,
      "height": 512,
      "bytes": 8552,
      "data_uri": "data:image/png;base64,…"
    },
    {
      "name": "site.webmanifest",
      "type": "application/manifest+json",
      "bytes": 511,
      "data_uri": "data:application/manifest+json;base64,ewogICJuYW1lIjogIkFQSUJveCBEZW1vIiwKICAic2hvcnRfbmFtZSI6ICJEZW1vIiwK…"
    }
  ],
  "warnings": []
}

Use cases

  • Favicon set for a new website or landing page in one call
  • Site builders and CMS that let customers upload a logo
  • Letter icons for internal tools and staging sites
  • PWA icons and manifest for an existing web app

FAQ

Which files do I really need?

favicon.ico at the site root, the SVG or 96 px PNG for modern browsers, apple-touch-icon.png for iOS and the manifest with 192 / 512 px icons for Android and PWAs. The returned HTML references all of them.

What size should the source be?

A square SVG is best. For PNG / JPEG use at least 512×512 px; smaller sources work but the large icons will look soft, and a warning is returned.

What is the maskable icon?

Android crops app icons to a circle or squircle. The maskable icon keeps the logo within the central 80% on a solid background so nothing important is cut off.

Related APIs

Start with 1,000 free requests every month. Get free API key →