google/uuid (Go)

Go package from Google for generating and parsing UUIDs (Universally Unique Identifiers). Supports UUID v1 (time-based), v3 (MD5 namespace), v4 (random), v5 (SHA-1 namespace), and v7 (time-ordered, monotonic). The most widely used UUID library in Go. v7 support (time-sortable UUIDs) added in v1.4+.

Evaluated Mar 06, 2026 (0d ago) v1.6+
Homepage ↗ Repo ↗ Developer Tools go uuid guid v4 v7 random id-generation google
⚙ Agent Friendliness
71
/ 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
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

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

Uses crypto/rand for UUID v4 — cryptographically secure random source. No network access.

⚡ Reliability

Uptime/SLA
95
Version Stability
90
Breaking Changes
88
Error Recovery
92
AF Security Reliability

Best When

Generating standard UUID identifiers in Go services for entities, requests, and distributed IDs.

Avoid When

You need sequential/sortable IDs for database performance — use UUID v7 or ULID instead of v4.

Use Cases

  • Generate random UUID v4 identifiers for database primary keys, request IDs, and entity identifiers
  • Generate time-ordered UUID v7 identifiers for database keys that benefit from sequential insertion ordering
  • Parse UUID strings from API requests with validation: uuid.Parse() returns error for invalid format
  • Use UUID v5 for deterministic namespace-based IDs: same inputs always produce the same UUID
  • Implement distributed ID generation without coordination by using UUID v4 random identifiers

Not For

  • High-performance sequential IDs — use database sequences or distributed ID generators (snowflake, ULID) if UUID randomness causes index fragmentation
  • Human-readable IDs — UUIDs are not human-friendly; use nanoid or short-uuid for user-visible IDs
  • Cryptographically secure tokens — use crypto/rand directly for security tokens; UUID v4 uses CSPRNG but isn't designed for this purpose

Interface

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

Authentication

Methods: none
OAuth: No Scopes: No

Library — no auth needed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

BSD 3-Clause licensed Google open source library.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • uuid.New() panics on random number generation failure — use uuid.NewRandom() which returns an error for production code that handles errors
  • UUID string format includes hyphens: '550e8400-e29b-41d4-a716-446655440000' — storing without hyphens requires manual stripping
  • UUID comparisons must use == operator on uuid.UUID type, not string comparison, to avoid case sensitivity issues
  • uuid.Parse() is case-insensitive for hex digits — '550E8400-...' and '550e8400-...' are equal after parsing
  • UUID v7 requires v1.4+ of the library — check version compatibility when using time-sortable UUIDs
  • Scanning UUIDs from SQL databases requires Scan() method or using uuid.UUID as the target type — sql.Scan treats UUID as [16]byte internally

Alternatives

Full Evaluation Report

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

$99

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

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