Avatars is an avatar placeholder library for designers and developers. You can choose between simple identicons and lovely designed characters.

And best of all: We provide a simple and free HTTP API that you can use right away!

avatar
Don't use sensitive or personal data as seed!
See README.md for advanced options
Create your ownarrow

How to use

You can start directly with our free HTTP-API or alternatively use the JavaScript library.

HTTP-API

Our free HTTP-API is the easiest way to use Avatars. Just use the following URL as image source.

https://avatars.dicebear.com/v2/:sprites/:seed.svg

Replace :sprites with male, female, identicon, gridy, avataaars or jdenticon. The value of :seed can be anything you like - but don't use any sensitive or personal data here!


The used sprite collection may offer additional options, which can be set using the GET parameter named options. For example, to create a happy male avatar with the seed john, the following URL can be used:

https://avatars.dicebear.com/v2/male/john.svg?options[mood][]=happy

NPM

Choose NPM if you want to use a spriteCollection that is not available via the HTTP-API.

Install the Avatars package with the following command.

$ npm install --save @dicebear/avatars

You also need to add a sprite collection. In our example, we will use the male sprite collection.

$ npm install --save @dicebear/avatars-male-sprites

Now you are ready to create your first Avatar.

import Avatars from '@dicebear/avatars';
import sprites from '@dicebear/avatars-male-sprites';

let options = {};
let avatars = new Avatars(sprites(options));
let svg = avatars.create('custom-seed');

Sprite Collections

Do you want to create male, female or abstract avatars?
You have the choice between several lovely designed sprite collections.

male

male

@dicebear/avatars-male-sprites

female

female

@dicebear/avatars-female-sprites

identicon

identicon

@dicebear/avatars-identicon-sprites

gridy

gridy

@dicebear/avatars-gridy-sprites

avataaars

avataaars

@dicebear/avatars-avataaars-sprites

jdenticon

jdenticon

@dicebear/avatars-jdenticon-sprites

Your sprite collection here?

You are a designer or developer and would like to contribute with a self-designed sprite collection?

Create an issue so that we can add your work to the list.

Frequently Asked Questions

What is this library best suited for?

DiceBear Avatars is best suited for designers and developers to create avatar placeholders. But you are free to use the generated avatars for other purposes.

Does a seed always return the same avatar?

Yes, as long as the same version of a sprite collection is used, a seed will always return the same avatar. This allows you to represent user identities with DiceBear Avatars, for example.

Will the library remain free of charge?

DiceBear Avatars is developed open source and will remain free of charge. We believe that everyone should be able to benefit from this library. Also we are always happy about improvements and extensions of contributors, which help us to make DiceBear Avatars even better.

Can I use an email address or other sensitive or personal information as a seed?

No! Sensitive or personal data should never be used as seed. The seed could be read from the source code. The generated avatar could also reveal the seed.