Developer UUID tools
PHP UUID Generator
Generate UUIDs for PHP applications, tests, database records, and API examples, then review practical package-based UUID patterns.
PHP UUID generator
Create UUID values for PHP fixtures, migrations, API payloads, and database examples.
123e4567-e89b-42d3-a456-426614174000 123e4567-e89b-42d3-a456-426614174001 123e4567-e89b-42d3-a456-426614174002 123e4567-e89b-42d3-a456-426614174003 123e4567-e89b-42d3-a456-426614174004 123e4567-e89b-42d3-a456-426614174005 123e4567-e89b-42d3-a456-426614174006 123e4567-e89b-42d3-a456-426614174007 123e4567-e89b-42d3-a456-426614174008 123e4567-e89b-42d3-a456-426614174009
Generate 1 to 1000 IDs per batch.
Generated values stay in your browser. This page does not send UUIDs or GUIDs to a server for generation.
Use a proper PHP UUID package
For application UUIDs, use a package that implements UUID versions correctly instead of assembling IDs by hand.
composer require ramsey/uuid<?php
use Ramsey\Uuid\Uuid;
$id = Uuid::uuid4()->toString();
echo $id;Why uniqid() is not the same as UUID
PHP uniqid() returns a time-based string, not a standards-compliant UUID. It is not a drop-in replacement for UUID v4, UUID v7, or database UUID columns.
Validate UUIDs in PHP
Use your UUID package's validation or parsing functions where available. Avoid trusting raw request strings without validation.
Common PHP UUID mistakes
Do not confuse uniqid() with UUID. Do not store hyphenated UUIDs in columns shorter than 36 characters. Prefer native UUID storage when your database supports it.
FAQ
How do I generate a UUID in PHP?+
Use a maintained UUID package such as ramsey/uuid and call its UUID v4 generation method.
Is uniqid() a UUID?+
No. uniqid() is not a standards-compliant UUID and should not be treated as one.
Can this page generate UUIDs for PHP tests?+
Yes. The live generator creates browser-side UUIDs you can copy into fixtures, migrations, or examples.