How Gravatar Links an Email Address to an Avatar Across Websites
Updated
Gravatar links an avatar to an email address by hashing that address and serving the image at a URL built from the hash. Any site that knows a visitor's email can compute the same hash and request the matching image, so one avatar follows you across every platform that has adopted the system. The binding is to the email, not your name, which is why the same person can run separate work, personal, and anonymous profiles.
The core mechanism: email in, hash out
The process has three steps:
- Normalize the email. Trim leading and trailing whitespace and convert all characters to lowercase.
- Hash the result. Apply SHA256 to the normalized string.
- Build the URL. Append the hash to
https://gravatar.com/avatar/.
The result is a plain image URL. No API key, no login, and no per-site upload is involved on the requesting side — the site only needs the email address it already has.
Gravatar's own developer examples show this directly. In JavaScript:
const sha256 = require( 'js-sha256' );
function getGravatarURL( email ) {
const address = String( email ).trim().toLowerCase();
const hash = sha256( address );
return `https://gravatar.com/avatar/${ hash }`;
}
And in PHP:
function get_gravatar_url( $email ) {
$address = strtolower( trim( $email ) );
$hash = hash( 'sha256', $address );
return 'https://gravatar.com/avatar/' . $hash;
}
Both snippets do the same thing: the email is the input, the hash is the identifier, and the returned URL is what an <img> tag points at.
Why the hash matters
Because the identifier is a hash of the email rather than the email itself, a site can display your avatar without storing your raw address in the image URL. The same email always produces the same hash, so every platform that implements the lookup independently arrives at the same image.
What happens when you update
Gravatar's pitch is "Update Once, Sync Everywhere." When you change your avatar or profile, the change appears across the platforms that pull from Gravatar. The mechanism is straightforward: those sites don't host a copy tied to your account — they request the image from the hash-based URL at load time. Change what that URL returns, and every requesting page shows the new version.
This is the practical difference between Gravatar and uploading a photo to each site separately. You maintain one profile; the sites do the lookup.
What the profile contains beyond the image
The avatar is only part of it. A Gravatar profile works like a digital business card and can include:
- A bio
- Social media profiles
- A portfolio or personal website
- Other verified links
That makes it usable as a link-in-bio page as well as an avatar source. Gravatar describes the profile as turning your email address into a "digital passport" — one avatar, one bio, social connections, and verified links.
Managing multiple identities
Because identity is tied to an email address rather than a name, you can run several profiles side by side. A work address, a personal address, and an anonymous address each hash to a different avatar and profile. Sites requesting the work address get the professional version; sites requesting the personal one get something else. You don't have to choose a single public identity.
Privacy controls
Gravatar states that you control what you share: you can make your profile private or choose what to share and when. The design intent is that your data stays yours. If you're deciding whether to use it, the relevant question is which email addresses you're willing to associate with a public profile, since the lookup works from the address itself.
For developers integrating it
Gravatar offers a REST API, SDKs, and tutorials for adding profiles to an application. The use case it names is bootstrapping a community with verified user profiles — avatars, social links, and more — without building that infrastructure yourself. The two snippets above are the minimal integration; the API extends it to profile data beyond the image.
Gravatar lists WordPress, GitHub, Slack, OpenAI, Atlassian, Figma, Mailchimp, Stack Overflow, and Coinbase among the platforms using it, which is why a single profile tends to appear in many places at once.
When this model fits — and when it doesn't
Gravatar is a good fit if you want one avatar and bio to follow an email address across many sites, or if you're building a product and want user avatars without hosting them. It's a weaker fit if you need per-site customization that differs from your global profile, or if you'd rather not associate a given email address with a discoverable public profile. The email is the key, so the choice of which address you use is the real decision.