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 20 Aug 2026

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 20 Aug 2026, 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

Alternatives to UI Avatars API

If UI Avatars does not fit, these photography & design apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.

APIWhat it doesAuthCORSLast verified
Metropolitan Museum of ArtFree Metropolitan Museum of Art API with no key: 470,000+ artworks with high-resolution public-domain images, artist data and full object metadata. Tested.No keyNo19 Aug 2026
Art Institute of ChicagoFree Art Institute of Chicago API with no key: 130,000+ artworks with IIIF images, colour data, artist info and rich metadata. Well documented. Tested example.No keyYes19 Aug 2026
Cleveland Museum of ArtFree Cleveland Museum of Art API with no key: 60,000+ artworks with open-access images, provenance, exhibition history and full metadata. Tested curl example.No keyNo19 Aug 2026
DiceBear AvatarsFree avatar generator API with no key: deterministic SVG or PNG avatars from any seed, in 30+ styles with customisable colours. Tested curl example.No keyYes19 Aug 2026
wsrv.nl (Images.weserv)Free image proxy and resizing API with no key: fetch any public image through a URL, resize, crop, convert format and serve it from a CDN. Tested example included.No keyYes21 Aug 2026
xColorsFree colour API with no key: generate random colours returned simultaneously as hex, RGB and HSL, or convert between the three formats. Tested example included.No keyYes21 Aug 2026
All Photography & Design APIs

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