How To Generate UUID v4 IDs In The Format You Need
3 min read
Test records often need identifiers before they have useful names. The free UUID Generator creates UUID v4 values you can copy into fixtures, prototypes or sample payloads.
Choose a batch of 1, 5, 10, 25 or 50 IDs. Select lowercase, uppercase, no dashes or braced format, then copy the results. The tool uses your browser's crypto API to generate version 4 values.
Check The Destination's Format
Start with the field that will receive the ID. Does it expect a dashed UUID, a no-dash value or a braced string? Follow that requirement rather than choosing a format because it looks neater.
For a fictional booking-app prototype, you might give each sample appointment its own ID. Copy one generated value into a test record first and check that the form, parser and stored record accept it. Then generate the rest of the batch in the same format.
Keep the copied batch with the test data it belongs to. Changing the quantity or format generates a new batch; it does not reformat the IDs already on screen. Set both before copying. Use Regenerate when you want another batch, and Copy all when you want to take the displayed values into your project.
Keep Existing References Intact
If other records already refer to an ID, changing it can break those references. For new sample data, decide the format before adding relationships between records.
For existing data, check the application's storage and comparison rules before changing case or punctuation. A different-looking string is not automatically a different underlying UUID.
Use The IDs For Records
An identifier helps a system refer to a record. The application still needs its own uniqueness checks and access permissions. Keep those checks in the system receiving the values rather than expecting a copied batch to supply them.
Use sample IDs with sample data, and verify that each relationship points to the intended record. If a sample appointment refers to a sample customer, check that the customer ID matches the referenced record exactly.
Generate Your First Batch
Open the UUID Generator, choose the format your destination expects and start with one ID. Check that your test record accepts it, then choose the larger quantity and copy the batch into your fixtures.
