Example initial avatars

UI Avatars

Generate avatars with initials from names.

UI Avatars has a simple-to-use API with no limiting or login. No usage tracking and no information is stored. The final images are cached, but nothing else. Just write name or surname, or both.

+5,157,554,124 Monthly requests
2.8931ms Avg. Processing Time
OtterWise Code Coverage tracking

Usage

All requests returns a image stream to be used directly in a <img/> tag.

Generate a avatar with default settings, for user "John Doe".

https://eu.ui-avatars.com/api/?name=John+Doe

Generate a blue avatar

https://eu.ui-avatars.com/api/?background=0D8ABC&color=fff

Generate a random background avatar.

Avoid passing color as it will be automatically set between black and white.

https://eu.ui-avatars.com/api/?background=random

Settings

Image Size (size)

Avatar image size in pixels. Between: 16 and 512. Default: 64

https://eu.ui-avatars.com/api/?size=128

Font Size (font-size)

Font size in percentage of size. Between 0.1 and 1. Default: 0.5

https://eu.ui-avatars.com/api/?font-size=0.33

Initial Characters (length)

Length of the generated initials. Default: 2

https://eu.ui-avatars.com/api/?length=1

Name (name)

The name used to generate initials. You can specify the initials yourself as well. Default: John Doe

https://eu.ui-avatars.com/api/?name=Elon+Musk

Rounded Image (rounded)

Boolean specifying if the returned image should be a circle. Default: false

https://eu.ui-avatars.com/api/?rounded=true

Bold (bold)

Boolean specifying if the returned letters should use a bold font. Default: false

https://eu.ui-avatars.com/api/?bold=true

Background Color (background)

Hex color for the image background, without the hash (#). Default: f0e9e9

https://eu.ui-avatars.com/api/?background=a0a0a0

Font Color (color)

Hex color for the font, without the hash (#). Default: 8b5d5d

https://eu.ui-avatars.com/api/?color=ff0000

Uppercase (uppercase)

Decide if the API should uppercase the name/initials. Default: true

https://eu.ui-avatars.com/api/?uppercase=false&name=different+Case

Format (format)

Decide if the API should return SVG or PNG. Default: svg if the Accept header includes image/svg+xml, png otherwise

https://ui-avatars.com/api/?format=svg

All settings above can be mixed together as you desire.

With gravatar or similar

A good use-case would be using it as a fallback for Gravatar. Example:

https://www.gravatar.com/avatar/EMAIL_MD5?d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/Lasse+Rafn/128

Because of limitations in Gravatar, we must pass in the parameters as sub-directories, instead of query-parameters. You should also consider urlencoding the name, in case it contains special characters. It's a limitation by Gravatar, not UI Avatars.

The order is as follows:

Retina

I recommend using 1.5x or 2x sizes for your avatars, but keeping the img tag the original size, to ensure crisp avatars on high DPI screens.

Language/Script support

I have added support for some unicode scripts/languages that are not supported by the typical fonts. Current support:

Wordpress plugin

It has Wordpress plugin! If you have a Wordpress site, you can use the Wordpress plugin, which is also free.

Privacy and Monitoring

No data is being stored on our serveres. Monitoring & logging is entirely disabled.


Help us scale to more regions, and keep running. We're serving 5,157,554,124 requests a month, and can use any contribution you're able to give. Thank you!

Your logo will show up here with a link to your website. Become a sponsor