# UUID v1, v4 & v7 Generator — Use Case Guides For the full tool, see: [https://capytoolkit.com/tools/developer/uuid-generator/](https://capytoolkit.com/tools/developer/uuid-generator/) [Generating a UUID for a Database Primary Key](https://capytoolkit.com/tools/developer/uuid-generator/generate-uuid-for-database-primary-key/): Choose between UUID v4 and v7 for a new table's primary key, and see how each one behaves inside a B-tree index under real insert load. [UUID v4 vs v7: Which One Sorts Chronologically](https://capytoolkit.com/tools/developer/uuid-generator/uuid-v4-vs-v7-for-sorting/): Check whether v4 or v7 gives you chronological order for an event stream or message log, and what the timestamp encoding actually looks like. [Generating a UUID for a Session Token or CSRF Nonce](https://capytoolkit.com/tools/developer/uuid-generator/generate-uuid-for-session-token/): Generate a cryptographically random UUID for a session ID or CSRF nonce, and see why Math.random() is the wrong source for either one. [Formatting a UUID for a Windows or COM API](https://capytoolkit.com/tools/developer/uuid-generator/format-uuid-for-windows-com/): Generate a UUID and format it in braces or uppercase for Windows registry keys, COM interfaces, and legacy interop code that expects that shape. [Bulk Generating a Batch of UUIDs for Test Fixtures](https://capytoolkit.com/tools/developer/uuid-generator/bulk-generate-uuids/): Generate a handful of UUIDs quickly for test fixtures or import IDs, entirely client-side, and see when a script beats clicking one row at a time.