TL;DR
DiceBear is a free avatar generator API that creates unique, deterministic avatars based on a seed string. With over 20 avatar styles — including pixel art, bottts, identicon, avataaars, lorelei, adventurer, fun-emoji, and more — you can generate consistent profile pictures for any user by passing their username or ID as the seed. The API returns SVG images that scale infinitely, with PNG output also available. Customization options include background color, primary color, and style-specific options like accessories, clothing, and facial features. No API key or rate limits.
Quick start: https://api.dicebear.com/9.x/pixel-art/svg?seed=john
No API key needed — just make a request!
How to Use This API
1. Basic Pixel Art Avatar
https://api.dicebear.com/9.x/pixel-art/svg?seed=john
2. Bottts (Robot Style)
https://api.dicebear.com/9.x/bottts/svg?seed=alice
3. Identicon (Geometric Pattern)
https://api.dicebear.com/9.x/identicon/svg?seed=project42
4. Avataaars (Customizable Character)
https://api.dicebear.com/9.x/avataaars/svg?seed=Sarah&accessories=eyepatch&top=longHairBigHair
5. Lorelei (Modern Illustration Style)
https://api.dicebear.com/9.x/lorelei/svg?seed=Alex&backgroundColor=b6e3f4
6. Adventurer (Adventure Character)
https://api.dicebear.com/9.x/adventurer/svg?seed=Luna&backgroundColor=ffd5dc
7. PNG Output
https://api.dicebear.com/9.x/pixel-art/png?seed=john&size=200
Use /png instead of /svg for raster output. Add size parameter for exact dimensions.
8. Response Format
The SVG endpoint returns raw SVG content (image/svg+xml). The PNG endpoint returns a PNG image (image/png). Use the image directly in an <img> tag as shown below.
9. HTML — Use as Profile Image
<!-- Deterministic avatar from username -->
<img src="https://api.dicebear.com/9.x/avataaars/svg?seed=Sarah"
alt="Sarah's avatar" width="100" height="100">
<!-- With background color -->
<img src="https://api.dicebear.com/9.x/lorelei/svg?seed=Alex&backgroundColor=b6e3f4"
alt="Alex" width="80" height="80">
10. JavaScript — Generate Avatars for Users
const users = [
{ name: 'Alice', id: 1 },
{ name: 'Bob', id: 2 },
{ name: 'Charlie', id: 3 }
];
users.forEach(user => {
const seed = `${user.name}-${user.id}`;
const url = `https://api.dicebear.com/9.x/pixel-art/svg?seed=${seed}`;
const img = document.createElement('img');
img.src = url;
img.alt = `${user.name}'s avatar`;
img.className = 'avatar';
document.getElementById('user-list').appendChild(img);
});
11. Python — Download Avatars in Bulk
import requests
usernames = ['alice', 'bob', 'charlie', 'diana', 'evan']
for name in usernames:
url = f'https://api.dicebear.com/9.x/bottts/svg?seed={name}'
resp = requests.get(url)
with open(f'avatars/{name}.svg', 'w') as f:
f.write(resp.text)
print(f'Saved avatar for {name}')
https://api.dicebear.com/9.x/pixel-art/svg?seed=john
Frequently Asked Questions
- What avatar styles are available?
- Over 20 styles: pixel-art, bottts, identicon, avataaars, lorelei, adventurer, adventurer-neutral, big-ears, big-ears-neutral, big-smile, croodles, croodles-neutral, fun-emoji, icons, initials, micah, miniavs, notionists, notionists-neutral, open-peeps, personas, ring, shapes, thumbs, and more. Each style produces a distinct visual aesthetic.
- How does the seed mechanism work?
- The seed string determines the avatar deterministically — the same seed always produces the exact same avatar. Use a username, user ID, email, or any unique string. For extra uniqueness, combine multiple fields:
?seed=username-123. - Can I customize colors and other options?
- Yes! Most styles support common options:
backgroundColor(hex without #),primaryColor,secondaryColor, andtextColor. Style-specific options vary — for example, avataaars supportsaccessories,top,hairColor,facialHair,clothes, etc. Check the style's docs for details. - What output formats are supported?
- SVG (scalable vector) is the primary format, returned by default. For PNG raster output, use
/pnginstead of/svgin the URL path. PNG supports asizeparameter for dimensions. SVG is recommended for most use cases due to quality and file size. - Is there a rate limit or need for an API key?
- No API key required and no documented rate limit. DiceBear is free for both personal and commercial use. For very high-traffic applications, consider self-hosting the open-source generator.
- Can I use DiceBear in commercial products?
- Yes! All avatar styles are free for any use, including commercial applications, SaaS products, mobile apps, and websites. Some style artwork may have specific licenses — check the DiceBear website for style-specific attribution requirements.
What You Can Build
- User profile avatars for web apps, forums, and social networks
- Anonymous user identification with consistent icons (e.g., chat rooms, polls)
- Gaming profile pictures with pixel-art or adventure character style
- Placeholder avatars during sign-up flows before users upload photos
- Chat application user icons with bottts or identicon style for each contact
- Dynamic contributor avatars for blog comments using email hash as seed