uuid (npm)

RFC 4122 compliant UUID generation for JavaScript and Node.js. Supports UUIDv1 (time-based), UUIDv3 (namespace MD5), UUIDv4 (random), UUIDv5 (namespace SHA1), and UUIDv7 (time-ordered random, new in v10). UUIDv7 is increasingly preferred over v4 for database primary keys as it's sortable by creation time. The standard UUID library for JavaScript.

Evaluated Mar 06, 2026 (0d ago) v9.x / 10.x
Homepage ↗ Repo ↗ Developer Tools uuid unique-id v4 v7 id-generation javascript node browser rfc4122
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
97
/ 100
Is it safe for agents?
⚡ Reliability
91
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
92
Error Messages
85
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
92
Secret Handling
92

Uses Web Crypto API (CSPRNG) for randomness — cryptographically secure. UUIDv1 MAC address disclosure is a minor privacy concern. Zero third-party dependencies.

⚡ Reliability

Uptime/SLA
100
Version Stability
90
Breaking Changes
82
Error Recovery
92
AF Security Reliability

Best When

You need RFC-compliant UUID generation in JavaScript/TypeScript with well-defined version semantics and broad ecosystem compatibility.

Avoid When

You need short, URL-friendly IDs — nanoid generates shorter random IDs. For time-ordered sortable IDs with less overhead, consider ULID.

Use Cases

  • Generate unique IDs for agent session tracking, request correlation, and workflow execution identifiers with UUIDv4
  • Create sortable primary keys for agent event logs and database records using UUIDv7 — time-ordered UUIDs avoid index fragmentation
  • Produce deterministic UUIDs from namespace + name pairs using UUIDv5 for stable IDs based on content hashing (URL normalization, deduplication)
  • Correlate distributed agent traces and logs using UUID request IDs that are passed across service boundaries
  • Generate browser-compatible UUIDs using the Web Crypto API-based uuid implementation that works in both Node.js and browsers

Not For

  • Short human-readable IDs — UUIDs are 36 characters; use nanoid or cuid2 for compact, URL-safe unique IDs
  • Sequential database IDs with minimal storage overhead — use database auto-increment or ULID for smaller, sequential IDs
  • Random string generation beyond ID purposes — use crypto.randomBytes() directly for arbitrary random data generation

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — local ID generation library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

uuid npm package is open source and free.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • uuid v7+ is ESM-only for the main package — require('uuid') works but import { v7 } from 'uuid' requires proper ESM bundler setup; check bundler config
  • UUIDv1 encodes the MAC address of the generating machine — privacy concern for agents that distribute UUIDv1 IDs externally; prefer v4 or v7
  • UUIDv7 was added in uuid 9.0+ — verify your version has v7 support before using; older codebases may be on uuid 3.x or 7.x without v7
  • crypto.randomUUID() in Node.js 14.17+ generates UUIDv4 natively without the uuid package — no dependency needed for basic v4 generation
  • uuid parse() returns a Uint8Array, not a string — use uuid.stringify() to convert back; forgetting this causes subtle bugs when comparing UUIDs
  • UUID string comparison is case-sensitive in some implementations — normalize to lowercase with .toLowerCase() before comparing UUID strings

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for uuid (npm).

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered