PHPackages                             ramsey/uuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ramsey/uuid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ramsey/uuid
===========

A PHP library for generating and working with universally unique identifiers (UUIDs).

4.9.2(5mo ago)12.6k700.2M—9.2%519[17 issues](https://github.com/ramsey/uuid/issues)[4 PRs](https://github.com/ramsey/uuid/pulls)20MITPHPPHP ^8.0CI passing

Since Jul 20Pushed 3w ago133 watchersCompare

[ Source](https://github.com/ramsey/uuid)[ Packagist](https://packagist.org/packages/ramsey/uuid)[ RSS](/packages/ramsey-uuid/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (95)Used By (20)

ramsey/uuid
===========

[](#ramseyuuid)

 **A PHP library for generating and working with UUIDs.**

 [![Source Code](https://camo.githubusercontent.com/3ce75ecfbe232340c3f48a59eb79333eda4b262d879f843e5334313f0a9c6b28/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d72616d7365792f757569642d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ramsey/uuid) [![Download Package](https://camo.githubusercontent.com/696d012ead428b8db501f6677c24628c0867b2b6c093105e0b13cc92d30c8365/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616d7365792f757569642e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/ramsey/uuid) [![PHP Programming Language](https://camo.githubusercontent.com/adbe4d64999836a0b0eeaf304bb9631c497984e6782e75c897f46f786d73b739/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72616d7365792f757569642e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/c86223563257d104bc8d38645f1ba3e4f9eeb87c6664f663677da6ceee7412fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72616d7365792f757569642e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/ramsey/uuid/blob/4.x/LICENSE) [![Build Status](https://camo.githubusercontent.com/324ef224b362d58b412b603b7150ffbb43e8c62d4adbbcec8375f97f3a93d89e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616d7365792f757569642f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d342e78266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/ramsey/uuid/actions/workflows/continuous-integration.yml) [![Codecov Code Coverage](https://camo.githubusercontent.com/f408d8b21b2ca98d8c3332db06d4a35f1159ea8834650005f3dd3a48771291ad/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f72616d7365792f757569642f342e783f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://app.codecov.io/gh/ramsey/uuid/branch/4.x)

ramsey/uuid is a PHP library for generating and working with universally unique identifiers (UUIDs).

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

Much inspiration for this library came from the [Java](http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html) and [Python](http://docs.python.org/3/library/uuid.html) UUID libraries.

Installation
------------

[](#installation)

The preferred method of installation is via [Composer](http://getcomposer.org/). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require ramsey/uuid
```

Upgrading to Version 4
----------------------

[](#upgrading-to-version-4)

See the documentation for a thorough upgrade guide:

- [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/stable/upgrading/3-to-4.html)

Documentation
-------------

[](#documentation)

Please see  for documentation, tips, examples, and frequently asked questions.

Contributing
------------

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with [CONTRIBUTING.md](CONTRIBUTING.md).

Coordinated Disclosure
----------------------

[](#coordinated-disclosure)

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read [SECURITY.md](https://github.com/ramsey/uuid/blob/4.x/SECURITY.md) for instructions on submitting a vulnerability report.

ramsey/uuid for Enterprise
--------------------------

[](#ramseyuuid-for-enterprise)

Available as part of the Tidelift Subscription.

The maintainers of ramsey/uuid and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-ramsey-uuid?utm_source=undefined&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

Copyright and License
---------------------

[](#copyright-and-license)

The ramsey/uuid library is copyright © [Ben Ramsey](https://benramsey.com/) and licensed for use under the MIT License (MIT). Please see [LICENSE](https://github.com/ramsey/uuid/blob/4.x/LICENSE) for more information.

###  Health Score

83

—

ExcellentBetter than 100% of packages

Maintenance85

Actively maintained with recent releases

Popularity90

Widely adopted with strong download metrics

Community66

Healthy contributor diversity

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~66 days

Total

94

Last Release

63d ago

Major Versions

3.9.5 → 4.0.22021-09-24

3.9.6 → 4.2.32021-09-25

3.9.7 → 4.7.02022-12-19

3.x-dev → 4.7.22023-01-12

4.9.2 → 5.x-dev2025-12-14

PHP version history (14 changes)1.0.0PHP &gt;=5.3.3

3.0.0-alpha1PHP &gt;=5.4

3.6.0PHP ^5.4 || ^7.0

3.9.0PHP ^5.4 | ^7

3.9.2PHP ^5.4 | ^7 | ^8

4.0.0-alpha1PHP ^7.2 | ^8

4.0.0PHP ^7.2 || ^8

3.9.5PHP ^5.4 | ^7 | ~8.0.0 | ~8.1.0

4.0.2PHP ^7.2 || ~8.0.0

4.2.2PHP ^7.2 || ~8.0.0 || ~8.1.0

4.0.3PHP ^7.2 || ^8.0

3.9.6PHP ^5.4 | ^7.0 | ^8.0

4.3.0PHP ^8.0

5.x-devPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f514481fa9cfdfd5dbcaccb3e5b480f18ea05ebf331cddf9b1c5a2a96a78fef5?d=identicon)[ramsey](/maintainers/ramsey)

---

Top Contributors

[![ramsey](https://avatars.githubusercontent.com/u/42941?v=4)](https://github.com/ramsey "ramsey (908 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (117 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (35 commits)")[![jmauerhan](https://avatars.githubusercontent.com/u/4204262?v=4)](https://github.com/jmauerhan "jmauerhan (35 commits)")[![marijn](https://avatars.githubusercontent.com/u/65233?v=4)](https://github.com/marijn "marijn (8 commits)")[![mhujer](https://avatars.githubusercontent.com/u/353372?v=4)](https://github.com/mhujer "mhujer (7 commits)")[![pawel-slowik](https://avatars.githubusercontent.com/u/2052273?v=4)](https://github.com/pawel-slowik "pawel-slowik (7 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (6 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (6 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (5 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (5 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (4 commits)")[![mjrider](https://avatars.githubusercontent.com/u/213105?v=4)](https://github.com/mjrider "mjrider (4 commits)")[![mloureiro](https://avatars.githubusercontent.com/u/3427665?v=4)](https://github.com/mloureiro "mloureiro (4 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (4 commits)")[![Potherca](https://avatars.githubusercontent.com/u/195757?v=4)](https://github.com/Potherca "Potherca (4 commits)")[![simPod](https://avatars.githubusercontent.com/u/327717?v=4)](https://github.com/simPod "simPod (3 commits)")[![ghola](https://avatars.githubusercontent.com/u/932205?v=4)](https://github.com/ghola "ghola (3 commits)")[![vudaltsov](https://avatars.githubusercontent.com/u/2552865?v=4)](https://github.com/vudaltsov "vudaltsov (3 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (3 commits)")

---

Tags

guididentifiersphpphp8uiduuiduuididentifierguid

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ramsey-uuid/health.svg)

```
[![Health](https://phpackages.com/badges/ramsey-uuid/health.svg)](https://phpackages.com/packages/ramsey-uuid)
```

###  Alternatives

[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)[oittaa/uuid

A small PHP class for generating RFC 9562 universally unique identifiers (UUID) from version 3 to version 8.

50302.7k5](/packages/oittaa-uuid)[ramsey/identifier

A PHP library for generating and working with identifiers, including UUIDs, ULIDs, and Snowflakes

603.0k1](/packages/ramsey-identifier)[ekreative/uuid-extra-bundle

Paramconverter, Normalizer and Form Type for Ramsey Uuid

18168.6k](/packages/ekreative-uuid-extra-bundle)[sudiptpa/guid

A minimal GUID generator package for PHP.

14135.8k1](/packages/sudiptpa-guid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
