How to use the UUID Generator

Overview

A practical guide to using UUIDs for temporary IDs and test data.

Quick answer: UUID v4 is a good fit when you want a random-looking identifier. Use it as an identifier, not as a replacement for sequential numbering.

1. When UUID v4 makes sense

UUID v4 works well for temporary record IDs, primary keys in test data, and internal identifiers that humans do not need to remember. Think of it as a uniqueness-first value rather than a user-facing number.

2. Do not use it as a sequence

UUIDs are random enough that they do not reveal creation order. If you need to count records or infer order, keep a separate field for that job so the responsibilities stay clear.

  • Keep display numbers separate
  • Watch for copy mistakes when placing it in URLs
  • Use fixed values and random values differently in tests

3. Practical usage tips

UUIDs are handy for local development data and placeholder records. It is worth checking whether the receiving system expects a string, and whether it treats uppercase and lowercase differently.

Browse all guides

Open the full guides page to compare articles and jump to another topic.

Open guides page