Beautiful, privacy-first avatar generation API. Generate stunning avatars with initials from any name.
Live Demo • Quick Start • API Reference • Self-Hosting
- Privacy First — No tracking, no cookies, no data storage. We never see or store your users' names.
- Blazing Fast — Served from 300+ edge locations worldwide via Cloudflare Workers.
- Free & Open Source — No API keys, no rate limits, no signup required. MIT licensed.
- SVG Output — Crisp at any resolution, tiny file sizes, perfect for retina displays.
- Fully Customizable — Colors, sizes, fonts, shapes. Make avatars that match your brand.
Just use it as an image source. No signup, no API keys.
<img src="https://textavatars.com/api?name=John+Doe" alt="John Doe"><img
src="https://textavatars.com/api?name=Sarah+Chen&background=6366f1&color=fff&rounded=true&bold=true"
width="64"
height="64"
alt="Sarah Chen"
>function Avatar({ name, size = 48 }) {
const params = new URLSearchParams({
name,
size,
background: 'random',
rounded: true,
bold: true
});
return (
<img
src={`https://textavatars.com/api?${params}`}
width={size}
height={size}
alt={name}
/>
);
}GET https://textavatars.com/api
| Parameter | Default | Description |
|---|---|---|
name |
John Doe | Name to generate initials from |
size |
64 | Image size in pixels (16-512) |
background |
f0e9e9 | Background color (hex without #) or random |
color |
auto | Text color (hex). Auto-contrasts if not set |
length |
2 | Number of initials to display |
font-size |
0.5 | Font size as ratio of image (0.1-1.0) |
rounded |
false | Circular avatar (true/false) |
bold |
false | Bold text (true/false) |
uppercase |
true | Uppercase initials (true/false) |
# Basic
https://textavatars.com/api?name=John+Doe
# Custom colors
https://textavatars.com/api?name=Alice&background=ec4899&color=fff
# Random background (deterministic per name)
https://textavatars.com/api?name=Bob&background=random
# Circular, bold, large
https://textavatars.com/api?name=Jane+Smith&rounded=true&bold=true&size=128
TextAvatars is designed to be easily self-hosted on Cloudflare Workers.
- Node.js (v18+)
- Cloudflare account (free tier works great)
-
Clone the repository
git clone https://github.com/yourusername/textavatars.git cd textavatars -
Install dependencies
npm install
-
Login to Cloudflare
npx wrangler login
-
Deploy
npm run deploy
Your worker will be available at https://textavatars.<your-subdomain>.workers.dev
To use a custom domain, update wrangler.toml:
routes = [
{ pattern = "avatars.yourdomain.com/*", zone_name = "yourdomain.com" }
]TextAvatars is extremely cost-effective to run:
| Monthly Requests | Estimated Cost |
|---|---|
| Up to 3 million | Free |
| 10 million | ~$5 |
| 100 million | ~$32 |
With caching, your actual costs will be significantly lower.
We take privacy seriously:
- No cookies — Ever.
- No tracking — No analytics, no pixels, no fingerprinting.
- No data storage — Names are processed in memory and immediately discarded.
- No logs — Unless you explicitly enable them for your self-hosted instance.
- Stateless — Every request is independent. We don't know who you are.
Your users' names never touch a database. They're rendered into an SVG and forgotten.
Contributions are welcome! Whether it's:
- Bug reports
- Feature requests
- Documentation improvements
- Code contributions
Please feel free to open an issue or submit a pull request.
# Install dependencies
npm install
# Start local development server
npm run dev
# Run type checking
npx tsc --noEmitMIT License — feel free to use this in personal and commercial projects.
Inspired by ui-avatars.com by Lasse Rafn.
Built with care using Cloudflare Workers