# Modern Unique ID Generator

Generate modern unique identifiers: ULID, NanoID, Snowflake and CUID2. Compare formats, decode ULID timestamps and pick the right ID for your system.

> Canonical page: https://elysiatools.com/en/tools/uid-generator

- **Category:** Generator

- **Keywords:** ulid, nanoid, snowflake, cuid2, unique id, identifier, sortable id, distributed id

## Overview

The Modern Unique ID Generator allows developers to instantly generate secure, collision-resistant, and sortable identifiers including ULID, NanoID, Snowflake, and CUID2. You can customize ID lengths, configure distributed machine parameters for Snowflake IDs, or decode existing ULID strings to extract their embedded timestamps.

## Inputs

- **ID Format** (select)
- **How Many** (number): Number of IDs to generate (1-500)
- **Length (NanoID / CUID2)** (number): ID length for NanoID and CUID2. Ignored for ULID/Snowflake.
- **Worker ID (Snowflake)** (number): Machine/worker id within the datacenter (Snowflake only).
- **Datacenter ID (Snowflake)** (number): Datacenter id for distributed deployments (Snowflake only).
- **Custom Epoch (Snowflake, ms)** (number): Base epoch in ms. Defaults to Twitter epoch (1288834974657). Snowflake only.
- **Decode ULID (optional)** (text): When filled, the tool decodes this ULID and ignores other options.

## When to use

- When designing database schemas that require URL-friendly, secure, or chronologically sortable primary keys.
- When configuring distributed systems that need Snowflake IDs with specific worker and datacenter configurations.
- When debugging or auditing data by extracting creation timestamps directly from existing ULID strings.

## How it works

- Select your preferred identifier format from ULID, NanoID, Snowflake, or CUID2.
- Adjust generation parameters such as the total count, custom length, or Snowflake-specific worker and datacenter IDs.
- Click generate to output the list of unique identifiers, or paste a ULID into the decode field to extract its creation timestamp.

## Use cases

- Generating secure, non-sequential API keys or public tokens using NanoID or CUID2.
- Creating chronologically sortable database keys using ULID to optimize index performance.
- Simulating distributed ID generation for microservices using custom Snowflake worker configurations.

## Frequently asked questions

### What is the difference between ULID and CUID2?

ULID is lexicographically sortable and contains a timestamp, making it ideal for database indexing, while CUID2 is designed for security, collision resistance, and unpredictability in horizontal scaling.

### How do I decode a ULID timestamp?

Paste the ULID string into the decode input field, and the tool will extract and display the exact millisecond timestamp encoded within it.

### Can I customize the length of all ID formats?

No, length customization is only supported for NanoID and CUID2. ULID and Snowflake have fixed-length specifications.

### What parameters are required for Snowflake IDs?

You can configure the Worker ID (0-1023), Datacenter ID (0-31), and a custom epoch timestamp in milliseconds.

### How many unique IDs can I generate at once?

You can generate up to 500 unique identifiers in a single batch.

## Related tools

- [JavaScript Deobfuscator](https://elysiatools.com/en/tools/javascript-deobfuscator): Deobfuscate and analyze obfuscated JavaScript code to improve readability and understanding
- [UUID Validator](https://elysiatools.com/en/tools/uuid-validator): Validate UUID format, detect version, and analyze UUID structure including variant, timestamp, and node information
- [UUID Generator](https://elysiatools.com/en/tools/uuid-generator): Generate UUIDs (v1, v4, v5)
- [ICCID Generator](https://elysiatools.com/en/tools/iccid-generator): Generate valid ICCID numbers for SIM cards with proper Luhn checksums
- [Image Custom Matrix](https://elysiatools.com/en/tools/image-custom-matrix): Apply custom 2x2 transformation matrix to images. Input any four matrix values \[a, b; c, d\] to create unique transformations. Great for learning linear algebra and image processing.
- [Luhn Checksum Calculator](https://elysiatools.com/en/tools/luhn-checksum): Validate or generate numbers using the Luhn algorithm (mod-10). Works for credit cards, IMEI, IMEISV, SIN, NPI and any custom Luhn-based identifier.
- [NTP RFC 5905 / SNTP Leap Second & Epoch Decoder](https://elysiatools.com/en/tools/ntp-rfc-5905-sntp-leap-second-epoch-decoder): Decode an NTP/SNTP 48-byte packet: LI/VN/Mode bitfield, stratum, poll, precision, root delay/dispersion, reference ID (with clock & kiss codes), and four 64-bit 1900-epoch timestamps
- [Snowflake / Discord ID Bit Decoder](https://elysiatools.com/en/tools/snowflake-discord-id-bit-decoder): Decode 64-bit Snowflake-style IDs for Discord, Twitter, Mastodon, Sonyflake, Instagram, or a custom bit profile. Extract timestamp, worker/process/machine, sequence fields, align platform epochs, and infer a Discord shard when a shard count is supplied.

## Samples

- [K6 Modern Performance Testing Tool](https://elysiatools.com/en/samples/k6-performance-testing): Comprehensive K6 performance testing examples including load testing, stress testing, API performance testing, and advanced patterns for modern applications
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

## Related content

- [Text Redaction, Highlighting, and Presentation Formatting Tools](https://elysiatools.com/en/hubs/text-format): Compare tools for masking sensitive text, finding PII, normalizing phone numbers, highlighting phrases, centering text, and formatting diffs in one hub.
- [JSON Formatting, Diff, and Normalization Tools](https://elysiatools.com/en/hubs/json-format): Compare JSON formatting, diffing, log review, config comparison, and data-normalization tools in one hub for readable and reviewable JSON workflows.
- [Code and Markup Minify, Beautify, and Format Tools](https://elysiatools.com/en/hubs/code-minify-beautify-format-tools): Minify and beautify CSS, HTML, JavaScript, JSON, SQL, XML, YAML, TOML, SVG, and VBA, lint Markdown and email HTML, and format code across languages in one hub for production and review workflows.
