Developer knowledge base

UUID guides by language and task

Start with the job you need to do: generate an identifier in code, choose a database key, validate input, or convert a UUID without changing its value.

Generate and inspect UUIDs

Choose a version, generate a batch, or inspect an existing identifier.

Generate UUIDs in your language

Use runtime APIs and libraries in application code, with parsing and compatibility notes.

Code guide

Generate UUIDs in JavaScript

Generate UUIDs in modern JavaScript with crypto.randomUUID, browser-safe fallbacks and practical validation notes.

Code guide

Generate UUIDs in Python

Use Python UUID examples for uuid4, validation, database storage and API output.

Code guide

PHP UUID Generator: UUID v4 Examples

Create UUID v4 values with plain PHP, Composer or Laravel, then validate input and choose a consistent database representation.

Code guide

Generate UUIDs in Go

Generate UUIDs in Go with the google/uuid package, including UUID v4, UUID v7, parsing and validation.

Code guide

Generate UUIDs in Rust

Generate UUIDs in Rust with the uuid crate, including UUID v4, UUID v7, parsing and feature flags.

Code guide

Generate UUIDs in Java

Generate UUIDs in Java with java.util.UUID, parse strings, and add UUID v7 with a maintained library.

Code guide

Generate UUIDs (GUIDs) in C#

Generate GUIDs in C# with Guid.NewGuid, parse and validate them, and create UUID v7 on .NET 9 and later.

Code guide

Generate UUIDs in TypeScript

Generate UUIDs in TypeScript with crypto.randomUUID in browsers and Node, plus typed validation helpers.

Code guide

Generate UUIDs in Ruby

Generate UUIDs in Ruby with SecureRandom.uuid, validate strings, and use UUIDs in Rails models.

Code guide

Generate UUIDs in Kotlin

Generate UUIDs in Kotlin via Java interop or the multiplatform kotlin.uuid API, with parsing examples.

Code guide

Generate UUIDs in C++

Generate UUIDs in C++ using Boost.UUID, with random v4 generation and string conversion examples.

Code guide

Generate UUIDs in Bash and the Terminal

Generate UUIDs from the command line with uuidgen or /proc, including lowercase output and bulk generation.

Store UUIDs in databases

Compare native storage types, byte ordering and primary-key choices before changing a schema.

Format and export identifiers

Preserve the UUID value while changing its text representation or export format.

Compare UUIDs with other IDs

Check ordering, text length and collision tradeoffs for ULID and Nano ID.

Privacy and production use

Understand browser generation, offline behavior, collision risk and authorization boundaries.

Architecture and production decisions

For broader design decisions and common production mistakes, read the UUID blog.

UUID Guides - Languages, Databases, Formats and Tools