UUID generator — random UUID v4 for databases, APIs, and distributed systems

Use this free online UUID generator to create RFC 4122 version 4 identifiers: statistically unique 128-bit values formatted as hyphenated hex strings. Generate a single primary key or bulk UUIDs for seed scripts, message queues, and correlation IDs. Output stays in your browser via crypto.randomUUID() (or a secure fallback), so drafts never leave your machine. Switch between standard hyphens, compact 32-character form, and uppercase when your stack expects it. Pair generation with our JSON formatter & validator for readable API payloads, or CSV to JSON when you are shaping tabular seed files before import.

Output format

Showing 5 random UUID v4 values. Each click on Generate new UUIDs replaces the list using your current count.

Uses crypto.randomUUID() when available, otherwise getRandomValues with RFC 4122 version 4 and variant bits.

Why teams use UUID v4 instead of auto-increment integers

A UUID (Universally Unique Identifier) lets clients propose IDs before insert, merge replicas without sequence clashes, and expose opaque values in URLs. Version 4 is the common choice when you want random UUID generation without embedding MAC addresses (as in v1) or depending on a single database sequence. Trade-offs include slightly wider columns and index locality compared with time-ordered IDs—if you care about B-tree fragmentation, research UUID v7 or ULIDs for your datastore. This page focuses on v4 because ORMs, OpenAPI examples, and most tutorials assume it.

When you validate that a column matches UUID syntax, exercise the pattern in our regex tester & debugger against sample rows.

How to use this UUID generator (step by step)

  1. Enter how many values you need (1–500). Typical uses: one ID for a manual SQL insert, ten for a unit test, or a hundred for a CSV import dry run.
  2. Choose With hyphens for the canonical 8-4-4-4-12 shape (xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx), Compact (no hyphens) for 32 hex characters in tight logs or legacy validators, or Uppercase when your organization standardizes on capital hex.
  3. Click Generate new UUIDs to replace the entire list. Previous lines are discarded so you always know the batch is fresh.
  4. Click Copy all and paste into your editor, migration, or API client. For checksums on arbitrary strings (not random IDs), use the hash generator instead.

Keywords and search intents this tool covers

Engineers often search for a GUID generator online, Postgres UUID generator, REST API UUID example, or bulk UUID generator for tests. This page answers those intents with a private, no sign-up workflow. If you need to embed binary data or build data URIs after assigning IDs, the Base64 encoder & decoder and YAML to JSON converters help keep config and API examples consistent.

Privacy, security, and when not to use UUID v4

Random UUIDs are excellent for uniqueness and safe exposure in many APIs, but they are not a password or session secret by themselves—use dedicated secret APIs and rotation policies for auth material. Because generation runs locally, you can draft migrations on VPN or air-gapped notes without uploading schemas. For readable migration SQL that references new UUID columns, pretty-print statements with the SQL formatter before code review.

UUID v4 in databases and ORMs (quick reference)

PostgreSQL offers gen_random_uuid(); MySQL 8+ supports UUID(); SQL Server uses NEWID(). In application code, prefer the platform UUID type over strings when available. The strings you copy here match what those functions produce in standard textual form, so you can paste into migration files or CSVs that your loader casts to UUID.

Related developer tools

Explore the full code and developer tools catalog. Highlights:

  • JSON Formatter & ValidatorFormat, validate, minify, and explore JSON in a collapsible tree—fix payloads before they hit production.
  • JSON to CSV ConverterTurn JSON arrays into downloadable CSV with automatic column detection for spreadsheets and BI tools.
  • JSON to YAML ConverterConvert JSON to readable YAML for configs and Kubernetes—copy or download the result.
  • CSV to JSON ConverterPaste or upload CSV and get structured JSON with header-aware typing for APIs and apps.
  • YAML to JSON ConverterParse YAML to valid JSON with clear errors—ideal for CI configs and cloud templates.
  • XML Formatter & ValidatorBeautify and validate XML with structure insight and actionable parse errors.
  • Regex Tester & DebuggerTest patterns live with highlights, capture groups, and flags—debug regex without leaving the browser.
  • SQL FormatterPretty-print SQL with indentation and keyword casing for readable queries and code review.
  • HTML Formatter & MinifierBeautify or minify HTML and compare raw markup with a quick rendered preview.
  • CSS Formatter & MinifierFormat messy stylesheets or minify CSS for faster loads—keep design tokens consistent.
  • JavaScript Formatter & MinifierPretty-print or minify JavaScript for debugging locally and shipping smaller bundles.
  • HTML to Markdown ConverterConvert HTML snippets to Markdown for docs, CMS migrations, and README cleanup.
  • Markdown to HTML ConverterTurn Markdown into HTML with a live preview—handy for emails, blogs, and static pages.
  • Code Diff CheckerCompare two code blocks side by side with clear add/remove highlighting for reviews.

Frequently asked questions

What is a UUID and why use UUID v4?
A UUID (Universally Unique Identifier) is a 128-bit label, usually written as eight groups of hex digits with hyphens. Version 4 means the value is random (with standard version and variant bits). Teams use UUID v4 for primary keys, correlation IDs, file names, and API identifiers when you want low collision risk without a central allocator.
Are these UUIDs cryptographically secure?
This tool uses the browser’s Web Crypto API (crypto.randomUUID or crypto.getRandomValues), which is suitable for general uniqueness and typical app identifiers. For regulated security contexts (e.g. session tokens), follow your platform’s guidance and threat model—UUID v4 alone is not a substitute for proper secret generation where required.
Is my data sent to your servers?
No. Random bytes and formatting happen entirely in your browser tab. Nothing is uploaded unless you use another page that explicitly makes network requests.
Can I generate bulk UUIDs for seed data or migrations?
Yes. Set the count, choose output format (standard hyphens, compact without hyphens, or uppercase), then generate and copy. For very large batches or automation, prefer your database’s uuid_generate_random(), NewGuid(), or language libraries in scripts.
What is the difference between UUID v4 and v1 or v7?
UUID v4 is random. v1 embeds a timestamp and MAC-derived node (privacy concerns in some setups). v7 is time-ordered and newer—useful for database index locality. This page focuses on v4 because it is the most common choice for opaque IDs in APIs and ORMs.
Will uppercase UUIDs work the same as lowercase?
Yes. The canonical string form is often lowercase, but parsers typically treat hex case-insensitively. Pick uppercase only if your style guide or legacy system requires it.
How do I validate a string looks like a UUID?
Match the pattern eight-four-four-four-twelve hex digits, or use your language’s UUID parser. You can also prototype a validation regex in our regex tester and debugger, then port it to your backend or database constraint.
Which other developer tools pair with UUID generation?
Pretty-print JSON API examples with the JSON formatter and validator, convert seed spreadsheets with CSV to JSON, encode binary fields with the Base64 encoder and decoder, and format SQL migrations with the SQL formatter—all available in the code and developer tools section on the home page.