Generate GUID
Create Unique Identifiers for Databases and APIs
Generate a GUID for application data, database records, or distributed systems. The generator runs in your browser and returns a new identifier on demand.
A GUID (Globally Unique Identifier) is a 128-bit value used to identify data across systems. The term is often used interchangeably with UUID.
Use the generator with these steps:
- Select your preferred GUID version (v1 or v4).
- Click the “Generate GUID” button.
- Your new GUID will appear in the output box.
- Click the “Copy” button to copy the GUID for use in your project.
Two common GUID versions are available:
- GUID Version 1: Generated from a timestamp and node identifier. It can reveal generation timing.
- GUID Version 4: Randomly generated. This is a common default for most applications.
Example format (36 characters with hyphens):
3f2504e0-4f89-11d3-9a0c-0305e82c3301- Primary keys in databases.
- Public IDs in APIs and URLs.
- Correlation IDs for logs and tracing.
- Object identifiers in distributed systems.
A GUID has 128 bits, which yields an extremely large space of possible values. Collisions are considered practically negligible for typical applications.
JavaScript
Use the uuid npm package:
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // returns a new GUIDC#
Use the Guid.NewGuid() method:
Guid myGUID = Guid.NewGuid();
Console.WriteLine(myGUID);Python
Use the uuid module:
import uuid
print(uuid.uuid4())GUID and UUID refer to the same 128-bit identifier concept. GUID is commonly used in Microsoft contexts, while UUID aligns with RFC 4122 terminology.
If you need UUIDs, use the Generate UUID Online Tool.
Which GUID version should I choose? Use v4 for most apps; use v1 only when you need time ordering.
Are GUIDs secure secrets? No. GUIDs identify records; they are not encryption or access control.
Can GUIDs collide? Collisions are practically negligible for typical usage.