UUID Tool
Short UUID Generator
When a UUID is too long for a URL or a readable code, a 22-character base64url string keeps the same 128 bits of entropy in a tighter form.
22 chars (vs 36 for a UUID)URL-safe base64url128-bit entropy
Generated locally with the Web Crypto API — nothing leaves your browser.
What Is Short UUID Generator?
- A short UUID takes 16 random bytes and encodes them with base64url (no padding), producing 22 characters instead of 36.
- It carries the same 128 bits of randomness as a v4 UUID, so it is equally collision-resistant — just more compact and friendlier in links.
How to generate
- Press Generate to mint a 22-character ID.
- Use Copy to grab it, or generate several at once for a batch.
- Paste it directly into URLs, coupon codes, or short-link keys.
Use Cases
- Short links and slugs where length is visible to users.
- API keys and tokens that need to be typed or read aloud less often.
- Compact record identifiers in space-constrained storage.
How Short UUID Generator Compares
| Short UUID (22) | base64url of 16 bytes; compact, URL-safe |
| UUID v4 (36) | hex in 8-4-4-4-12; human-readable, standard |
| NanoID | Custom alphabet; similar compactness, different scheme |
Code Examples
JavaScript
const b = crypto.getRandomValues(new Uint8Array(16));
const id = btoa(String.fromCharCode(...b)).replace(/\+/g,'-').replace(/\//g,'_').slice(0,22);Python
import base64, os
id = base64.urlsafe_b64encode(os.urandom(16)).decode().rstrip('=')Frequently Asked Questions
Is a short UUID less safe than a v4 UUID?
No. It is the same 128 random bits, just encoded differently. Collision probability is identical.
Why 22 characters?
16 bytes = 128 bits. base64 encodes 6 bits per character, so 128/6 ≈ 21.3 → 22 characters (the padding '=' is dropped).
Can I decode it back to a UUID?
Yes — base64url-decode the 22 characters and reformat the 16 bytes into the 8-4-4-4-12 shape.