UUID and Short ID Generator
Generate UUIDv7, UUIDv4, ULID, NanoID, YouTube-like IDs, and other common short identifiers.
UUIDv7
36 characters with dashes, or 32 hex characters without dashes.
UUIDv7 combines a Unix millisecond timestamp with random bits. It keeps UUID compatibility while making newly generated values naturally time-ordered.
- Sortable
- Yes, by creation time
- URL-safe
- Path-safe, but long
- Best for
- Modern database primary keys
Pros
- Standards-based UUID format.
- Better index locality than UUIDv4.
- Works with UUID columns and common UUID libraries.
Cons
- Longer than short ID systems.
- Timestamp is visible in the ID.
- Not as compact as numeric 64-bit IDs.
Popular with: Used for modern database IDs, event records, and new systems that want UUID compatibility with time ordering.
UUIDv4
36 characters with dashes, or 32 hex characters without dashes.
UUIDv4 is the familiar random UUID. It is widely supported and easy to recognize, but it does not preserve creation order.
- Sortable
- No
- URL-safe
- Path-safe, but long
- Best for
- General-purpose random IDs
Pros
- Very widely supported.
- No timestamp or machine details are exposed.
- Simple default when ordering does not matter.
Cons
- Random insertion order can hurt database indexes.
- Long for public URLs.
- Less informative than timestamped IDs when debugging.
Popular with: Common in APIs, databases, logs, request IDs, and systems that accept GUID or UUID fields.
YouTube-like 11-character ID
11 URL-safe characters.
A compact random ID shaped like a YouTube video identifier. It is useful for share links and public slugs, but it is not a real YouTube ID.
- Sortable
- No
- URL-safe
- Yes
- Best for
- Short public links
Pros
- Very short and easy to paste.
- Works cleanly in URLs.
- Good fit for public-facing objects at moderate scale.
Cons
- Not a UUID standard.
- Collision risk depends on generation volume.
- No embedded creation time.
Popular with: Inspired by YouTube video IDs and useful for short share links, invite codes, and lightweight public slugs.
ULID
26 uppercase Crockford Base32 characters.
ULID stores time plus randomness in a shorter, URL-safe text format that sorts lexicographically by creation time.
- Sortable
- Yes
- URL-safe
- Yes
- Best for
- Readable sortable web IDs
Pros
- Shorter than UUID text.
- Lexicographically sortable.
- Easy to scan because ambiguous letters are omitted.
Cons
- Not a UUID column value.
- Timestamp is visible.
- Multiple IDs in the same millisecond may need monotonic generation for strict ordering.
Popular with: Popular in web apps, database-backed services, and Go or Rust projects that want sortable text IDs.
KSUID
27 Base62 characters.
KSUID was created by Segment for distributed systems. It embeds a timestamp and enough randomness for high-volume generation across services.
- Sortable
- Yes
- URL-safe
- Yes
- Best for
- Distributed backend services
Pros
- Time-sortable and compact.
- Large random payload.
- Works well when IDs are generated in many places.
Cons
- Not as universally supported as UUID.
- Timestamp is visible.
- Slightly longer than ULID.
Popular with: Created by Segment and often used in distributed backend systems, event streams, and service-generated records.
NanoID
21 URL-safe characters by default.
NanoID is a tiny random ID format with a customizable alphabet and length. The default gives a compact URL-safe identifier.
- Sortable
- No
- URL-safe
- Yes
- Best for
- Frontend and API IDs
Pros
- Short, URL-safe, and easy to generate.
- Alphabet and length can be customized.
- Friendly for browser and Node.js apps.
Cons
- Not time-sortable.
- Not a UUID standard.
- Shorter custom lengths increase collision risk.
Popular with: Common in JavaScript and TypeScript projects, including frontend apps, APIs, and libraries that need compact random IDs.
CUID2-style
24 lowercase alphanumeric characters.
CUID2 focuses on hard-to-guess public identifiers. This browser generator creates CUID2-shaped random IDs; use the official library when exact CUID2 semantics matter.
- Sortable
- No
- URL-safe
- Yes
- Best for
- Public-facing records
Pros
- Lowercase and URL-friendly.
- Designed for public IDs that should not be predictable.
- Comfortable fit for JavaScript and TypeScript apps.
Cons
- Not lexicographically sortable.
- Not a UUID standard.
- Exact production behavior depends on the reference implementation.
Popular with: Seen in JavaScript and TypeScript ecosystems and supported by tools that offer CUID or CUID2-style IDs.
Snowflake
64-bit integer, usually 18 to 19 decimal digits today.
Snowflake IDs combine a timestamp, machine or worker ID, and sequence number into a compact sortable integer.
- Sortable
- Yes
- URL-safe
- Numeric
- Best for
- Large coordinated systems
Pros
- Compact numeric ID.
- Monotonically increasing per worker.
- Excellent for high-volume database inserts.
Cons
- Requires coordinated worker IDs in production.
- Timestamp and worker shape can be inferred.
- Clock problems can break ordering guarantees.
Popular with: Invented at Twitter and adapted by services such as Discord and many large internal backend systems.
MongoDB ObjectId
24 lowercase hex characters.
ObjectId is MongoDB's compact 12-byte identifier. It includes a timestamp, process-shaped randomness, and a counter.
- Sortable
- Mostly by second
- URL-safe
- Yes
- Best for
- MongoDB documents
Pros
- Compact hex representation.
- Built into MongoDB.
- Timestamp can help with rough ordering and debugging.
Cons
- Not globally time-ordered within the same second.
- MongoDB-specific shape.
- Timestamp is visible.
Popular with: Used by MongoDB collections and tooling wherever ObjectId is the default document identifier.
XID
20 lowercase Base32 characters.
XID is a compact sortable ID from the Go ecosystem, designed as a modern ObjectId-style identifier.
- Sortable
- Yes
- URL-safe
- Yes
- Best for
- Go services
Pros
- Only 20 characters.
- Fast to generate.
- Sortable and friendly for logs or URLs.
Cons
- Less common outside Go services.
- Timestamp is visible.
- Not a UUID standard.
Popular with: Popular through the Go rs/xid library and services that want compact ObjectId-like IDs.
Sonyflake
64-bit integer, usually 17 to 19 decimal digits today.
Sonyflake is a Snowflake-inspired 64-bit layout with a different timestamp unit and sequence allocation.
- Sortable
- Yes
- URL-safe
- Numeric
- Best for
- Snowflake alternatives
Pros
- Compact numeric ID.
- Time-ordered.
- Useful when a Snowflake-like layout fits your infrastructure.
Cons
- Requires a machine ID strategy in production.
- Lower per-machine sequence space than classic Snowflake.
- Less widely recognized than UUID or Snowflake.
Popular with: Used as a Snowflake alternative in systems that prefer Sonyflake's timestamp and machine-ID layout.
What it does
Identifier formats trade off standards support, length, sortability, URL safety, and operational complexity. UUIDv7 is a strong modern default because it keeps UUID compatibility while adding timestamp order that databases handle well.
Short ID systems such as ULID, NanoID, KSUID, CUID2, ObjectId, XID, Snowflake, and YouTube-like IDs are useful when URLs, logs, or user-facing records need something more compact or easier to sort.
Common uses
- Use UUIDv7 for new database primary keys when you want a standards-based, time-ordered UUID.
- Use UUIDv4 when you need the most familiar random UUID format and do not care about sort order.
- Use ULID, KSUID, NanoID, or CUID2-style IDs for URL-friendly web app identifiers.
- Use Snowflake or Sonyflake only when your infrastructure can coordinate machine IDs and sequences.
Watch outs
- Dashes are part of the canonical UUID text format. Turning them off produces the same 128-bit UUID as a 32-character hex string.
- Browser-generated Snowflake and Sonyflake values are useful examples, but production systems need coordinated worker or machine IDs.
- YouTube-like IDs are URL-safe 11-character random strings. They are not real YouTube video IDs.
Privacy
IDs are generated in your browser with Web Crypto randomness. No generated value is sent to Crypto Lambda.
FAQ
Which ID should I choose by default?
Choose UUIDv7 for most new systems. It is standards-based, has 128 bits of space, embeds time for ordering, and still fits UUID columns and libraries.
Should UUIDs include dashes?
Use dashes when another system expects canonical UUID text. Remove dashes when you specifically need a compact 32-character hex string.
Are short IDs always safe for public URLs?
Not automatically. NanoID, CUID2-style IDs, ULID, and KSUID are URL-safe, but collision risk depends on length, randomness, and generation volume.
Related tools
Base64
Convert text to Base64, decode Base64 back to UTF-8, and switch to Base64URL for tokens, JWT segments, and URL-safe payloads.
URL Encoder
Encode and decode URL components or full URLs, with clear errors for malformed percent escapes.
SVG Data URI
Convert pasted SVG markup into Base64, URL-encoded, CSS-ready, and sandboxed preview formats without uploading a file.