UUID with Spaces – Leading and Trailing Whitespace Validation

Local only

Explain the UUID validator's trim behavior with a canonical UUID surrounded by spaces.

40 chars · 1 line

Waiting for input

Valid UUID v4

UUID input normalization

Do leading or trailing spaces make a UUID invalid?

VetaTool trims leading and trailing whitespace before checking UUID syntax. A canonical UUID surrounded by ordinary spaces can therefore validate successfully, while spaces inserted inside the UUID still break the required 8-4-4-4-12 layout. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Canonical 8-4-4-4-12 UUID validation
  • UUID version inspection
  • RFC 4122 variant checking
  • Nil UUID recognition
  • Uppercase hexadecimal support
  • Browser-local validation

Steps

  1. Paste the UUID exactly as copied, including surrounding spaces.
  2. Let the validator trim leading and trailing whitespace.
  3. If validation still fails, inspect the canonical UUID characters and hyphen positions themselves.

Only surrounding whitespace is normalized

The inspector calls trim before UUID validation, so spaces before the first hexadecimal digit or after the final digit are ignored.

Whitespace inside the UUID is different. It changes the canonical text and causes the format check to fail.

Whitespace-trimmed UUID example

The input contains spaces around an otherwise canonical UUID v4.

UUID input

  550e8400-e29b-41d4-a716-446655440000  

Validation result

Valid UUID v4

Common questions

Frequently asked questions

Does VetaTool trim tabs and newlines too?

The validator uses JavaScript string trim(), which removes standard leading and trailing whitespace before validation.

Are spaces allowed inside a UUID?

No. Internal spaces break the canonical 8-4-4-4-12 UUID text layout and fail the format check.

Debugging a specific UUID issue? Browse UUID troubleshooting.