BYTETOOLS

UI Avatars API

Free initials avatar API with no key: generate clean letter avatars from any name, with custom colours, size, shape and font weight. URL-based. Tested.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-20

What is the UI Avatars API?

UI Avatars is a free, key-free API that generates a clean avatar image containing a person's initials, derived automatically from their name, with configurable colours, size, shape and font weight.

Initials avatars are the standard fallback when a user has not uploaded a photo, and this API generates them from a URL alone — no image processing, no storage, no key.

It extracts initials automatically from whatever name you pass, handling multi-word names sensibly. Combined with a per-user background colour derived from their id, it produces a consistent, professional-looking default that most products end up building themselves.

Quick facts

Base URL
https://ui-avatars.com/api
Authentication
No API key required.
Rate limit
No published limit; responses are cacheable and CDN-friendly.
Pricing
Free, including commercial use.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the UI Avatars API

Every request below was executed against the live API on 2026-08-20, and the response shown is the real body it returned — not an illustration.

1. Generate an initials avatar

GET https://ui-avatars.com/api/?name=Byte+Tools&size=128&background=0D8ABC&color=fff

curl
curl 'https://ui-avatars.com/api/?name=Byte+Tools&size=128&background=0D8ABC&color=fff'
JavaScript (fetch)
const res = await fetch("https://ui-avatars.com/api/?name=Byte+Tools&size=128&background=0D8ABC&color=fff");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://ui-avatars.com/api/?name=Byte+Tools&size=128&background=0D8ABC&color=fff", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
# This endpoint returns image/png, not JSON.
# The response body is the image itself, so it can be used directly as an
# <img src="..."> or saved to a file — there is nothing to parse.
#
# Verified: HTTP 200, Content-Type: image/png

Parameters

ParameterTypeRequiredDescription
namestringRequiredFull name; initials are derived from it. Use + for spaces. Byte+Tools
sizeintegerOptionalImage size in pixels, 16-512. 128
backgroundstringOptionalBackground colour as hex without the hash, or `random`. 0D8ABC
colorstringOptionalText colour as hex without the hash. fff
roundedbooleanOptionalCircular rather than square. true
boldbooleanOptionalBold initials. true
formatstringOptionalpng or svg. svg

Response fields

(image)image
The response body is the avatar image itself, not JSON.

What you can build with the UI Avatars API

  • Provide default avatars for users without profile photos
  • Generate consistent team member placeholders
  • Fill design mockups with realistic user avatars
  • Create letter-based icons for organisations or projects

Common errors and how to fix them

Wrong initials

Name parsing takes the first letter of the first two words.

Fix: Pass the name in the order you want initials derived from, using + between words.

Colours ignored

Hex values include a # character.

Fix: Pass bare hex, e.g. background=0D8ABC.

Inconsistent colours per user

You used background=random.

Fix: Derive a stable colour from the user's id instead, so their avatar never changes.

UI Avatars API — frequently asked questions

Is UI Avatars free?

Yes, free with no API key, and permitted for commercial use.

How are the initials chosen?

From the first letters of the first two words in the name you pass. Use + between words so it parses correctly.

How do I give each user a consistent colour?

Derive the background colour deterministically from their user id rather than using background=random, which changes on every request.

Should I use PNG or SVG?

SVG is smaller and scales cleanly, so prefer it unless something in your pipeline requires a raster image.

Tools that pair with this API

UI Avatars is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-20; always check the official documentation before relying on this API in production, as terms and limits can change.