UUID Format

Short UUID Format

Base64url-encoding the same 16 random bytes turns a 36-character UUID into a 22-character string with identical entropy.

22 charactersbase64url safe128-bit entropy

Generated locally with the Web Crypto API — nothing leaves your browser.

What Is Short UUID Format?

How to generate

  1. Generate — the engine produces 22-character base64url IDs.
  2. Copy one, or generate a batch for several records.
  3. Paste directly into URLs, short links or redemption codes.

Use Cases

How Short UUID Format Compares

Short (22)base64url of 16 bytes — compact and URL-safe
UUID v4 (36)hex in 8-4-4-4-12 — standard and human-readable
NanoIDCustom alphabet, similar length, different scheme

Code Examples

JavaScript
const b = crypto.getRandomValues(new Uint8Array(16));
const id = btoa(String.fromCharCode(...b))
  .replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
Python
import base64, os
id = base64.urlsafe_b64encode(os.urandom(16)).decode().rstrip('=')

Frequently Asked Questions

Is a short ID as unique as a UUID?
Yes — identical 128-bit entropy. Only the encoding differs, so collision odds are the same.
Why exactly 22 characters?
16 bytes is 128 bits and base64 carries 6 bits per character: 128 ÷ 6 ≈ 21.33, rounded up to 22.
Can I convert a short ID back to a UUID?
Yes — base64url-decode it to 16 bytes, then format those bytes as 8-4-4-4-12.

Related tools