UUID Generator Bulk UUID Generator GUID Generator Blog About Contact ⚡ Generate UUID
RFC 4122 / RFC 9562 Compliance Checker

Free UUID Validator Online

Validate UUID format, version, variant, and structure instantly. Check UUID v1, v4, v5, and v7 compliance.

Enter UUID(s) above and click Validate to see results

Quick Test UUIDs:

UUID Validator: Complete Guide to Validating UUID Formats

A UUID validator is an essential tool for developers working with Universally Unique Identifiers. This online UUID validator provides instant validation of UUID strings, checking format compliance, version detection, and RFC 4122/9562 conformance. Whether you need to validate UUID v1 for legacy systems, verify UUID v4 format for API keys, or check UUID v7 structure for database records, this comprehensive tool handles all UUID versions.

Understanding UUID Format Validation

The UUID format validator checks several critical aspects of each identifier:

  • Total length must be exactly 36 characters (32 hex + 4 hyphens)
  • Segments must follow the 8-4-4-4-12 pattern
  • All characters must be valid hexadecimal (0-9, a-f, A-F)
  • Hyphens must be in correct positions (after 8th, 13th, 18th, 23rd characters)
  • Version bits must indicate a supported UUID version
  • Variant bits must follow RFC 4122/9562 specifications

UUID Validator Regex Patterns

A UUID validator regex provides quick pattern matching for format verification. Here are the most common patterns:

Standard UUID Validator Regex

^[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}$

UUID v4 Validator Regex

^[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}$

UUID v7 Validator Regex

^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$

Non-Hyphenated UUID Validator

^[0-9a-fA-F]{32}$

UUID Validator JavaScript Implementation

For JavaScript developers, here's how to implement a UUID validator in both browser and Node.js environments:

// UUID validator JavaScript function isValidUUID(uuid) { const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; return regex.test(uuid); } // UUID v4 validator function isValidUUIDv4(uuid) { const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; return regex.test(uuid); } // Using npm package // npm install uuid import { validate, version } from 'uuid'; console.log(validate('550e8400-e29b-41d4-a716-446655440000')); // true console.log(version('550e8400-e29b-41d4-a716-446655440000')); // 4

UUID Validator TypeScript

// UUID validator TypeScript function isValidUUID(uuid: string): boolean { const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; return regex.test(uuid); }

UUID Validator Python Implementation

Python provides built-in support for UUID validation through its standard library:

# UUID validator Python import uuid def is_valid_uuid(uuid_string): try: uuid_obj = uuid.UUID(uuid_string) return str(uuid_obj) == uuid_string.lower() except (ValueError, AttributeError): return False # Check specific version def get_uuid_version(uuid_string): try: return uuid.UUID(uuid_string).version except ValueError: return None

Pydantic UUID Validator

# Pydantic UUID validator for data models from pydantic import BaseModel, UUID4 class UserModel(BaseModel): id: UUID4 # Automatically validates UUID v4 # Custom UUID validator from pydantic import validator import uuid class CustomModel(BaseModel): user_id: str @validator('user_id') def validate_uuid(cls, v): try: uuid.UUID(v) return v except ValueError: raise ValueError('Invalid UUID format')

UUID Validator Java Implementation

For Java developers, here's how to implement UUID validation:

import java.util.UUID; public class UUIDValidator { public static boolean isValidUUID(String uuid) { try { UUID.fromString(uuid); return true; } catch (IllegalArgumentException e) { return false; } } public static int getVersion(String uuid) { try { return UUID.fromString(uuid).version(); } catch (IllegalArgumentException e) { return -1; } } }

Apache Commons UUID Validator

import org.apache.commons.validator.routines.UUIDValidator; public class CommonsUUIDValidation { public static void main(String[] args) { String uuid = "550e8400-e29b-41d4-a716-446655440000"; boolean isValid = UUIDValidator.getInstance().isValid(uuid); System.out.println("Valid: " + isValid); } }

Spring Boot UUID Validation

For Spring Boot applications, here are multiple approaches:

import org.springframework.validation.annotation.Validated; import javax.validation.constraints.Pattern; @Validated public class UserRequest { @Pattern(regexp = "^[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}$", message = "Invalid UUID format") private String userId; }

Jakarta UUID Validator Annotation

import jakarta.validation.constraints.Pattern; public class Entity { @Pattern( regexp = "^[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}$", message = "Must be a valid UUID" ) private String id; }

Hibernate UUID Validator

import org.hibernate.validator.constraints.UUID; public class User { @UUID private String id; }

UUID Validator Go (Golang)

import ( "fmt" "github.com/google/uuid" ) func isValidUUID(s string) bool { _, err := uuid.Parse(s) return err == nil }

Node.js Frameworks UUID Validation

NestJS UUID Validator

import { IsUUID } from 'class-validator'; export class UserDto { @IsUUID('4', { message: 'Must be a valid UUID v4' }) id: string; }

Zod UUID Validator

import { z } from 'zod'; const UserSchema = z.object({ id: z.string().uuid(), });

Angular UUID Validator

import { Validators } from '@angular/forms'; const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; const form = new FormGroup({ userId: new FormControl('', [ Validators.required(), Validators.pattern(uuidPattern) ]) });

UUID Version Validators

Different UUID versions require specific validation checks:

UUID v1 Validator

Check that the third group starts with '1'. UUID v1 also contains timestamp and node information that can be decoded.

UUID v4 Validator

Verify that the third group starts with '4' and the fourth group starts with 8, 9, a, or b. This confirms both version and variant compliance.

UUID v5 Validator

Check that the third group starts with '5'. UUID v5 uses SHA-1 hashing for deterministic generation.

UUID v7 Validator

Verify that the third group starts with '7'. UUID v7 also contains a Unix timestamp in the first 48 bits.

Bulk UUID Validation

Our online UUID validator supports batch validation of multiple UUIDs simultaneously. This is particularly useful for:

  • Auditing database records for UUID integrity
  • Validating UUIDs from API responses
  • Checking UUID formats in configuration files
  • Testing UUID generation implementations
  • Data migration validation

Best Practices for UUID Validation

When implementing UUID validation in your applications:

  • Normalize input by trimming whitespace and converting to lowercase
  • Accept both hyphenated and non-hyphenated formats when appropriate
  • Use version-specific validation when you expect a particular UUID version
  • Validate UUIDs at all API boundaries
  • Log validation failures for debugging
  • Use library functions over custom regex when available

Conclusion

This comprehensive UUID validator provides instant format, version, and variant validation for all UUID types. Whether you need a UUID v4 validator for API development, a UUID v7 validator for database records, or a general UUID format validator for data migration, this tool ensures your identifiers meet RFC standards. With support for JavaScript, Python, Java, TypeScript, Go, and framework-specific implementations like NestJS, Zod, Hibernate, and Angular, you have everything needed for robust UUID validation.

Frequently Asked Questions

What is a UUID validator? ↓

A UUID validator checks whether a string conforms to the UUID format defined in RFC 4122 and RFC 9562. It verifies the 8-4-4-4-12 hexadecimal structure, version bits, and variant bits.

What regex validates UUID format? ↓

The standard UUID regex is ^[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}$. Version-specific patterns add version number checks.

How do I validate UUID v4? ↓

Check that the third group starts with '4' and the fourth group starts with 8, 9, a, or b. Use regex: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

How do I validate UUID v7? ↓

Check that the third group starts with '7'. UUID v7 also contains a Unix timestamp in the first 48 bits that can be decoded and verified.

Can I validate multiple UUIDs at once? ↓

Yes, you can validate multiple UUIDs by pasting them line by line into the validator. Each UUID is validated independently with detailed feedback.