OPEN SOURCE · MIT LICENSE

TappyAvatar —
Deterministic SVG Avatar Generator

The same string always renders the same avatar — every time. Fast, tiny, and dead simple to use: ~6.8 KB gzipped, ~5 µs per avatar, one file, zero dependencies. TappyAvatar turns any username, email, or ID into a unique SVG avatar right in the browser.

Library size6.8 KBgzipped, with comments
Speed~5 µsper avatar, measured on M4
Styles8with endless variants each
Live preview v1.0.0
Style snowflake
Raw SVG B
gzip B
seed →
Same name → same face, every time
One letter changed → a completely different avatar
Why TappyAvatar

Built for default avatars, with total determinism

No database, no stored images, no backend. A string goes in, an SVG comes out — server and client render byte-identical results.

hash

Deterministic

Same name, same style, byte-identical output. No reliance on time, randomness, or network — it looks the same every single time.

0 dep

Zero deps, zero requests

One file is all you need. Everything runs in the browser — no npm dependencies, no network calls, no backend.

6.8 KB

Absurdly small

The whole library is ~6.8 KB gzipped (with comments); a single avatar SVG is only 0.3–0.5 KB.

8 styles

8 styles × endless variants

Snowflake, plant, pixel, line, low-poly, robot, emoji, silhouette — each with plenty of random detail baked in.

8 Styles

One name, eight faces

Lock a style, or let the name pick for you (style: "auto"). Each card below renders three different names.

Playground

Live playground

Every option in the library, live: style, hue, background, dark mode, size. Type, tweak, and watch the avatar update instantly.

tappyAvatar("…") Generated locally in your browser — nothing is sent anywhere
auto
Stylesnowflake
Raw SVG
gzip
seed
tappyAvatar(name, { style, hue, background, dark, size, title })
Quick Start

Three lines of code, that is it

Works with the browser, Node, React, and mini apps alike. Install from npm or drop in the single tappy-avatar.js — either way you are done.

Installbash
npm install tappy-avatar
# or drop the single tappy-avatar.js file into your page
Browserhtml
<!-- tappyAvatar is now a global -->
<script src="./tappy-avatar.js"></script>
<script>
  document.body.innerHTML = tappyAvatar(user.id, {
    style: "pixel", size: 48,
    background: "circle"
  });
</script>
Node / CommonJSjs
const tappyAvatar = require("tappy-avatar");
// data URI, ready for <img> tags or CSS backgrounds
el.style.backgroundImage = `url("${tappyAvatar.uri(user.id)}")`;
And there is more: hue locks the palette, dark flips to dark mode, overrides pins any detail, style: "auto" lets the name choose. The full API is in the table below and in the GitHub docs.
OptionTypeDefaultDescription
stylekey or "auto""snowflake"Visual style; unknown values fall back to the default
sizenumberCSS decidesSets the width/height attribute (px); geometry is unaffected
huenumberName decidesLocks the hue to 0–360°; the name only drives the shape
backgroundcircle / square / squircleNone (transparent)Background shape behind the avatar
darkbooleanfalseDark mode (deeper fills and strokes)
pixelnumberName decidesLocks the pixel grid to 9 or 11
overridesobjectPin any trait to a specific 0–1 position
titlestringAccessible <title> for the SVG
Determinism guarantee: same name + same style → byte-identical output; different names → zero collisions across 8 styles × 1000 names (test corpus).
FAQ

Frequently asked questions

Quick answers on determinism, privacy, and how to plug it in.

What is TappyAvatar?

TappyAvatar is a fast, tiny, easy-to-use deterministic SVG avatar generator. It turns any username, email, or ID string into a unique SVG avatar right in the browser — frontend-only, zero dependencies, ~6.8 KB gzipped, 8 styles.

How do I install TappyAvatar?

Two ways: npm install tappy-avatar for Node, React, and bundler projects, or drop the single tappy-avatar.js file into your page and use the global tappyAvatar. Zero dependencies either way.

Can the same name produce different avatars?

No. TappyAvatar is deterministic: the same name and style always render a byte-identical SVG — no dependence on time, randomness, or the network, and server and client renders match exactly.

Does it need a backend?

No. Everything runs locally in the browser. The single tappy-avatar.js file is all you need — no network requests, and usernames never leave the page.

How fast is TappyAvatar, and how small is it?

Fast and tiny: ~5 µs per avatar. The whole library is ~6.8 KB gzipped (comments included), and a single avatar SVG is only 0.3–0.5 KB.

How do I use it with React, Vue, or mini apps?

The output is a plain SVG string, so it is framework-agnostic. Include the script and call tappyAvatar(name, { style }), or use tappyAvatar.uri() to get a data URI for an <img>. Works with React, Vue, mini apps, and SSR.

Can I use TappyAvatar commercially?

Yes. It is fully open source under the MIT license — use, modify, and ship it commercially with no attribution required. Source lives at github.com/tappypotato/TappyAvatar.

Drop TappyAvatar into your project

MIT licensed, so just use it. Forks, stars, and issues are all welcome — or simply copy the one file and you are live in ten seconds.

GitHub repo → Full playground Automated tests
MIT License · github.com/tappypotato/TappyAvatar · frontend-only · zero dependencies · single file