Dicebear Avatars

Development API · Pixel-art avatars · 10+ styles · Deterministic or random

TL;DR

Dicebear generates avatar images on the fly with no server-side processing. You can get pixel-art characters, bottts (robot-like), avataaars, icons, identicons, and more — all as vector SVG images. Each URL produces a unique avatar; pass a seed parameter to get the same avatar every time (deterministic generation). Perfect for user profile pictures, anonymous comment avatars, or placeholder identities.

Quick start: https://avatars.dicebear.com/7.x/pixel-art/svg

No API key needed — just make a request!

How to Use This API

1. Random Pixel-Art Avatar (SVG)

https://avatars.dicebear.com/7.x/pixel-art/svg

Returns an SVG image. Each request gives a new random avatar. Replace svg with png, jpg, or webp for raster formats.

2. Deterministic Avatar (Same Seed = Same Image)

https://avatars.dicebear.com/7.x/pixel-art/svg?seed=alice

The seed alice always generates the same avatar. Use a username or email hash as the seed for consistent profile pictures.

3. Different Styles

https://avatars.dicebear.com/7.x/bottts/svg?seed=robot
https://avatars.dicebear.com/7.x/avataaars/svg?seed=john
https://avatars.dicebear.com/7.x/identicon/svg?seed=hash
https://avatars.dicebear.com/7.x/initials/svg?seed=JD

4. JavaScript — User Avatar Component

function getAvatarUrl(username, style = 'pixel-art') {
  return `https://avatars.dicebear.com/7.x/${style}/svg?seed=${encodeURIComponent(username)}`;
}

// Display avatar for each user
const users = ['alice', 'bob', 'charlie'];
users.forEach(user => {
  const img = document.createElement('img');
  img.src = getAvatarUrl(user, 'avataaars');
  img.alt = `${user}'s avatar`;
  document.body.appendChild(img);
});

5. Python — Generate Default Avatars for Users

import requests

def avatar_url(username, style='bottts'):
    return (f'https://avatars.dicebear.com/7.x/{style}/svg'
            f'?seed={username}')

def download_avatar(username, style='pixel-art'):
    url = avatar_url(username, style)
    resp = requests.get(url)
    with open(f'{username}_avatar.svg', 'w') as f:
        f.write(resp.text)
    print(f"Saved {username}'s avatar")

usernames = ['alice', 'bob', 'charlie', 'diana']
for u in usernames:
    download_avatar(u)

# Or use initials style for clean geometric avatars
print(avatar_url('JS', 'initials'))
Try a random avatar: https://avatars.dicebear.com/7.x/pixel-art/svg

Frequently Asked Questions

What avatar styles are available?
10+ styles: pixel-art (retro game style), avataaars (modern facial), bottts (robot/tech), identicon (geometric hash), initials (text-based), micah (3D-ish), big-ears, big-smile, open-peeps, and more.
How do I get consistent avatars for users?
Use the seed parameter with any string. The same seed always produces the same avatar (deterministic based on seed hash). Great for user profile pictures without storing images.
What format options are available?
SVG (default, vector), PNG, JPG, and WebP. SVG is recommended for quality. For raster: /7.x/pixel-art/png?seed=alice. Customize size with ?size=128.
Can I customize colors and features?
Yes! Each style supports options like backgroundColor, primaryColor, facialHair, hair, etc. Check the Dicebear docs for style-specific options.
Are there usage limits?
Dicebear is free and open-source. Self-hosted options exist for high-volume production. The hosted version is fine for moderate usage without rate limits.
Can I use these avatars commercially?
Yes, Dicebear avatars are released under a permissive license (CC0 or MIT depending on style). Free for any use including commercial.

API Details

API URL
https://avatars.dicebear.com/
Documentation
avatars.dicebear.com
Category
Development
Authentication
Not Required
Geographic Coverage
Global

What You Can Build