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.
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 'https://ui-avatars.com/api/?name=Byte+Tools&size=128&background=0D8ABC&color=fff'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);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())# 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/pngParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Required | Full name; initials are derived from it. Use + for spaces. Byte+Tools |
size | integer | Optional | Image size in pixels, 16-512. 128 |
background | string | Optional | Background colour as hex without the hash, or `random`. 0D8ABC |
color | string | Optional | Text colour as hex without the hash. fff |
rounded | boolean | Optional | Circular rather than square. true |
bold | boolean | Optional | Bold initials. true |
format | string | Optional | png 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
Color Picker
Pick any color and get its HEX, RGB and HSL values instantly. Free online color picker with shades, tints and one-click copy for designers and developers.
Image Cropper
Crop images online to an exact rectangle with pixel-precise x, y, width and height inputs or aspect-ratio presets. Free, private and browser-based.
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.