Creating A UUID From A String With No Dashes
Answer : tl;dr java.util.UUID.fromString( "5231b533ba17478798a3f2df37de2aD7" .replaceFirst( "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5" ) ).toString() 5231b533-ba17-4787-98a3-f2df37de2ad7 Or parse each half of the hexadecimal string as long integer numbers, and pass to constructor of UUID . UUID uuid = new UUID ( long1 , long2 ) ; Bits, Not Text A UUID is a 128-bit value. A UUID is not actually made up of letters and digits, it is made up of bits. You can think of it as describing a very, very large number. We could display those bits as a one hundred and twenty eight 0 & 1 characters. 0111 0100 1101 0010 0101 0001 0101 0110 0110 0000 1110 0110 0100 0100 0100 1100 1010 0001 0111 0111 1010 1001 0110 1110 0110 0111 1110 1100 1111 1100 0101 1111 Humans do not easily read bits, so for convenience we usually represent the 128-bit value as a hexadecimal string made up...