Free tool - runs in your browser
UUID regex tester
Test UUIDs and GUIDs against a ready regex: any 8-4-4-4-12 hex value, v4, v7, any RFC 9562 version, GUIDs with braces or 32 digits without hyphens. Paste IDs one per line to see which match, with the version and variant of each, then copy the JavaScript regex or HTML pattern.
The 13th hex digit (index 14) must be 4 and the 17th (index 19) must be 8, 9, a or b: the RFC 9562 variant bits 10xx. This is what crypto.randomUUID() returns.
2 of 10 match
- Match
f47ac10b-58cc-4372-a567-0e02b2c3d479version 4, variant RFC 9562 (10xx) - No match
018f3c3e-7b2a-7c4d-9e1f-2a3b4c5d6e7f - No match
6ba7b810-9dad-11d1-80b4-00c04fd430c8 - No match
00000000-0000-0000-0000-000000000000 - Match
F47AC10B-58CC-4372-A567-0E02B2C3D479version 4, variant RFC 9562 (10xx) - No match
{f47ac10b-58cc-4372-a567-0e02b2c3d479} - No match
f47ac10b58cc-4372-a567-0e02b2c3d479 - No match
f47ac10b-58cc-4372-c567-0e02b2c3d479 - No match
g47ac10b-58cc-4372-a567-0e02b2c3d479 - No match
f47ac10b-58cc-4372-a567-0e02b2c3d47
HTML pattern uses the v flag and has no i flag, so the HTML version lists both a-f and A-F. Lowercase the value and check it again on your server before you save it.
UUID and GUID regex patterns
A UUID is 32 hex digits in groups of 8-4-4-4-12. The 13th digit is the version and the 17th digit holds the variant, which is 8, 9, a or b for RFC 9562 UUIDs. Default v4 pattern: /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i. Every preset below is checked against its match and no-match samples.
| Preset | Regex | Match / no match examples | Notes |
|---|---|---|---|
| Any UUID shape (8-4-4-4-12 hex) | ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ | Match: f47ac10b-58cc-4372-a567-0e02b2c3d479, F47AC10B-58CC-4372-A567-0E02B2C3D479, 6ba7b810-9dad-11d1-80b4-00c04fd430c8, 00000000-0000-0000-0000-000000000000, ffffffff-ffff-ffff-ffff-ffffffffffff, f47ac10b-58cc-4372-c567-0e02b2c3d479No match: g47ac10b-58cc-4372-a567-0e02b2c3d479, f47ac10b58cc-4372-a567-0e02b2c3d479, f47ac10b-58cc-4372-a567-0e02b2c3d47, {f47ac10b-58cc-4372-a567-0e02b2c3d479}, f47ac10b58cc4372a5670e02b2c3d479 | Checks only the 36-character 8-4-4-4-12 hex shape in any case. It does not look at the version or variant, so nil, max and non-RFC values all pass. |
| UUID v4 (random, RFC 9562) | /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i | Match: f47ac10b-58cc-4372-a567-0e02b2c3d479, F47AC10B-58CC-4372-A567-0E02B2C3D479, 550e8400-e29b-41d4-a716-446655440000No match: 018f3c3e-7b2a-7c4d-9e1f-2a3b4c5d6e7f, 6ba7b810-9dad-11d1-80b4-00c04fd430c8, 00000000-0000-0000-0000-000000000000, f47ac10b-58cc-4372-c567-0e02b2c3d479, g47ac10b-58cc-4372-a567-0e02b2c3d479, {f47ac10b-58cc-4372-a567-0e02b2c3d479} | The 13th hex digit (index 14) must be 4 and the 17th (index 19) must be 8, 9, a or b: the RFC 9562 variant bits 10xx. This is what crypto.randomUUID() returns. |
| UUID v7 (time-ordered, RFC 9562) | /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i | Match: 018f3c3e-7b2a-7c4d-9e1f-2a3b4c5d6e7f, 018F3C3E-7B2A-7C4D-9E1F-2A3B4C5D6E7F, 01932c07-209c-7a1e-b8f7-3c5d2e1f4a6bNo match: f47ac10b-58cc-4372-a567-0e02b2c3d479, 00000000-0000-0000-0000-000000000000, 018f3c3e-7b2a-7c4d-ce1f-2a3b4c5d6e7f, 018f3c3e7b2a7c4d9e1f2a3b4c5d6e7f | Same as v4 but the version digit is 7. The first 48 bits are a Unix timestamp in milliseconds, so v7 IDs sort by creation time and index well as database keys. |
| Any RFC 9562 version (v1-v8) | /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i | Match: 6ba7b810-9dad-11d1-80b4-00c04fd430c8, f47ac10b-58cc-4372-a567-0e02b2c3d479, 018f3c3e-7b2a-7c4d-9e1f-2a3b4c5d6e7f, 0e3f4a5b-6c7d-8e9f-a0b1-c2d3e4f5a6b7No match: 00000000-0000-0000-0000-000000000000, ffffffff-ffff-ffff-ffff-ffffffffffff, f47ac10b-58cc-9372-a567-0e02b2c3d479, f47ac10b-58cc-4372-c567-0e02b2c3d479 | Version digit 1 to 8 with the RFC 9562 variant. The nil UUID 00000000-0000-0000-0000-000000000000 and the max UUID ffffffff-ffff-ffff-ffff-ffffffffffff are separate special values and do not match; allow them with an extra check if you need them. |
| Microsoft GUID with optional braces | ^(?:\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$ | Match: {F47AC10B-58CC-4372-A567-0E02B2C3D479}, f47ac10b-58cc-4372-a567-0e02b2c3d479, {00000000-0000-0000-0000-000000000000}No match: {f47ac10b-58cc-4372-a567-0e02b2c3d479, f47ac10b-58cc-4372-a567-0e02b2c3d479}, {{f47ac10b-58cc-4372-a567-0e02b2c3d479}}, (f47ac10b-58cc-4372-a567-0e02b2c3d479) | The short form ^\{?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\}?$ also accepts a single opening or closing brace. This preset uses alternation so braces must be balanced: both or neither. |
| 32 hex digits, no hyphens | ^[0-9a-fA-F]{32}$ | Match: f47ac10b58cc4372a5670e02b2c3d479, F47AC10B58CC4372A5670E02B2C3D479, 00000000000000000000000000000000No match: f47ac10b-58cc-4372-a567-0e02b2c3d479, f47ac10b58cc4372a5670e02b2c3d47, g47ac10b58cc4372a5670e02b2c3d479 | The compact 32-digit form some databases and APIs use. Insert hyphens after digits 8, 12, 16 and 20 before you compare it with a hyphenated UUID. |
Validating UUIDs in a form
<form action="https://splitforms.com/api/submit" method="POST">
<input type="hidden" name="access_key" value="YOUR_KEY">
<label for="order-id">Order ID (UUID)</label>
<input id="order-id" name="order_id" type="text" pattern="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}" title="UUID such as f47ac10b-58cc-4372-a567-0e02b2c3d479" spellcheck="false" autocomplete="off" required>
<button type="submit">Send</button>
</form>The pattern attribute blocks a submit until the field holds a v4 UUID. HTML anchors the whole value and has no case-insensitive flag, so the pattern lists both a-f and A-F. Add required to reject an empty value. The form posts to splitforms, so each submitted ID arrives in your inbox.
// Generate: built into browsers and Node.js 19+
const id = crypto.randomUUID(); // always a lowercase v4
// Check: trim, lowercase, then test
const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
function parseUuid(input) {
const value = String(input).trim().toLowerCase();
return UUID_V4.test(value) ? value : null;
}Browser checks are easy to skip, so test the value again on your server. Generate new IDs with crypto.randomUUID() instead of building them by hand. When you check an ID, trim it, lowercase it and then run the regex, so that uppercase GUIDs and lowercase UUIDs are stored the same way.
UUID regex FAQ
What regex matches a UUID v4?
Use ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ with the i flag. The 4 at the start of the third group is the version, and the 8, 9, a or b at the start of the fourth group is the RFC 9562 variant. Random IDs from crypto.randomUUID() always match it.
What is the difference between a UUID and a GUID?
None in practice: GUID is Microsoft's name for the same 128-bit identifier. Windows and .NET often print GUIDs in uppercase and sometimes inside braces, such as {F47AC10B-58CC-4372-A567-0E02B2C3D479}. Use the GUID preset to accept balanced braces, or strip them before you test the value.
Is a UUID case sensitive?
No. RFC 9562 says the hex digits are case-insensitive on input and should be written in lowercase on output, so F47AC10B-... and f47ac10b-... are the same UUID. Use the i flag in JavaScript, list a-fA-F in an HTML pattern, and lowercase the value before you store or compare it.
How do I validate a UUID without hyphens?
Use ^[0-9a-fA-F]{32}$ for the compact 32-digit form. To check the version too, insert hyphens after digits 8, 12, 16 and 20 and test the result with a versioned regex. Accepting both forms is easiest if you remove hyphens from every value first and then test 32 digits.
What are the nil and max UUIDs?
The nil UUID 00000000-0000-0000-0000-000000000000 has every bit set to 0 and the max UUID ffffffff-ffff-ffff-ffff-ffffffffffff has every bit set to 1. They are special values defined in RFC 9562, not real IDs, so the versioned presets reject them. The generic 8-4-4-4-12 preset accepts both.
Regex patterns for form fields
Alphanumeric regex tester
Test letters and numbers, spaces, handles and Unicode patterns.
Email regex tester
Test email patterns against edge cases and your own list.
Phone number regex tester
Check numbers against E.164, US/Canada and digits-only patterns.
Password regex generator
Pick strength rules and copy the regex or HTML pattern.
ZIP code regex
US ZIP, ZIP+4, Canadian and UK postal code patterns.
Number regex tester
Test digits, decimals, money and thousands separators.
Date regex tester
Date formats, strict ranges and leap-year aware ISO patterns.
Name regex tester
Validate names with accents, hyphens and apostrophes.
Username regex tester
Test username length, separators and reserved names.
IP address regex tester
Validate IPv4, IPv6 and CIDR input with strict octets.
URL regex tester
Check website fields with regex, type=url or new URL().
HTML pattern attribute
How browsers anchor and check a pattern on an input.
HTML required attribute
Stop a form from sending while a field is empty.
Validate a form with JavaScript
Use checkValidity, custom messages and your own rules.
Time regex tester
Validate 24-hour, AM/PM and ISO 8601 time formats.
Credit card regex tester
Match card brands by prefix and length, then run a Luhn check.
Hex color regex tester
Match hex, rgb() and hsl() colors with range checks and swatches.
Use your validation patterns as you assemble a form with our HTML contact form code or HTML form generator.
More free form tools
Form backend cost calculator
Enter monthly submissions and compare the cheapest listed plan across eight form backends.
Email deliverability checker
Enter a domain to check its SPF, DMARC and MX records and get a plain-English fix for each.
SPF record checker
Look up a domain's SPF record, see each mechanism explained and count DNS lookups against the 10-lookup limit.
DMARC record generator
Pick a policy and report address and copy a ready _dmarc TXT record.
DMARC checker
Look up a domain's DMARC record and see the policy and every tag explained.
DKIM record checker
Enter a domain and selector to check its DKIM key, with presets for common senders.
SPF record generator
Tick your email providers and copy one SPF TXT record with a lookup count.
Contact form spam checker
Paste form HTML to audit its honeypot, endpoint, CAPTCHA markers and spam resistance.
Honeypot field generator
Generate a hidden anti-spam input with your chosen name and hiding technique.
Form action URL tester
Check a form action URL for reachability, CORS headers, POST acceptance and backend.
Email obfuscator
Encode your email so spam scrapers can't read it but people can still click it.
Mailto link generator
Build a mailto: URL with recipients, CC, BCC, subject and a pre-filled body.
HMAC-SHA256 generator
Generate and verify webhook signatures for common providers in your browser.
URL encoder and decoder
Encode text, build an x-www-form-urlencoded body or parse a query string.
UTM builder
Build campaign URLs with UTM parameters, tag a CSV in bulk and check tagged links.
HTML to JSX converter
Paste HTML and get JSX or a working React/Next.js form component.
Image to Base64 converter
Convert images to Base64 data URLs in your browser and copy HTML and CSS snippets.
Base64 to image converter
Paste a Base64 data URI to preview and download the decoded image.
Base64 decode & encode
Decode Base64 to readable UTF-8 text or encode text to Base64, locally in your browser.
URL to Base64 converter
Fetch a direct image URL in your browser and get its Base64 data URL.
AI form generator
Describe your form in plain English and copy working HTML.