← Developer

UUID Generator

Generate cryptographically random v4 UUIDs directly in your browser.

Version
Case

Generated UUIDs

Use this tool from AI agents

This tool's engine is available to AI agents over MCP as uuid_v4. Add the Clean.tools server, then your agent can call it directly.

Claude Code
claude mcp add --transport http clean-tools https://mcp.clean.tools/mcp
Claude Desktop (mcpServers)
{"mcpServers":{"clean-tools":{"command":"npx","args":["-y","@clean-tools/mcp"]}}}
Cursor
https://mcp.clean.tools/mcp

Or call it over plain HTTP from any script. Same engine, JSON in and JSON out, no key:

curl
curl -s https://api.clean.tools/v1/uuid_v4 \ -H 'content-type: application/json' \ -d '{"count":5,"uppercase":false}'
JavaScript
const res = await fetch('https://api.clean.tools/v1/uuid_v4', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ count: 5, uppercase: false }) }); const data = await res.json();

How it works

This tool generates version 4 and version 7 UUIDs (Universally Unique Identifiers) using the Web Crypto API's crypto.getRandomValues for cryptographic randomness. Each UUID is 128 bits formatted as 32 hexadecimal digits in the standard 8-4-4-4-12 pattern, with the version and variant nibbles set according to RFC 4122 and RFC 9562.

Pick v4 for fully random identifiers, or v7 for time-ordered ones: a v7 UUID starts with a 48-bit millisecond timestamp, so ids sort in creation order and are database-friendly as primary keys. All generation happens locally in your browser. No data is sent to a server. Generate up to 100 UUIDs at once, copy them individually or all at once, and toggle between uppercase and lowercase. Works on any modern browser, on both mobile and desktop. If you need the same v4 generation from scripts or an AI agent, the uuid-generator API exposes the uuid_v4 engine over HTTP and as an MCP server, and you can install the @clean-tools/mcp package from npm to run it locally.

Frequently asked questions

What UUID versions does this generate?

It generates version 4 and version 7. A v4 UUID is built almost entirely from random data: of the 128 bits, 6 are fixed to mark the version and variant, leaving 122 random bits. A v7 UUID (defined in RFC 9562) replaces the leading bits with a 48-bit Unix millisecond timestamp, so the ids are time-ordered and sort by creation time, which makes them friendlier as database primary keys than random v4 values. This tool does not generate name-based (v3 or v5) or the older time-based (v1) UUIDs.

Are these random enough to avoid collisions?

The random bits come from crypto.getRandomValues, the browser's cryptographically secure generator, not Math.random. With 122 random bits the odds of two v4 UUIDs colliding are vanishingly small, so they are safe to use as database keys or request identifiers without coordination.

Can I use a UUID as a secret token or password?

The randomness is strong enough, but UUIDs are conventionally treated as identifiers, not secrets, and are often logged or exposed in URLs. For API keys, session tokens, or passwords, use a dedicated generator instead so the value stays confidential.

Does uppercase or lowercase change the value?

No. RFC 4122 specifies lowercase for output but requires comparisons to be case-insensitive, so A and a represent the same UUID. The case toggle here is purely for display and copying to match whatever your system expects.

Can I use this from the command line or an AI agent?

Yes. The same generator is available as a REST endpoint at https://api.clean.tools/v1/uuid_v4, so you can POST a small JSON body from curl or any script and get UUIDs back. It is also an MCP server you can add to Claude, Claude Code, or Cursor, which lets an agent mint proper v4 UUIDs on demand. If you would rather run it locally, the @clean-tools/mcp package on npm starts it as a local stdio server.


More tools from Clean.tools

View all tools

Use Clean.tools from your AI agent

This tool is also uuid_v4 on the Clean.tools MCP server — the same engine, callable by your AI agent directly. No key, no signup: requests are processed in memory and request contents are never stored.

Claude Code
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcp
Any MCP client (streamable HTTP, authless)
https://mcp.clean.tools/mcp

Every tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →