UUID color calculation

How Minecraft Locator Bar Colors Are Calculated

This page is the calculation reference. It shows how a Minecraft Java UUID is turned into the default Locator Bar HEX and RGB color. Use the homepage checker when you want a lookup tool; stay here for the math, the bit operations, and verified examples.

Stone UUID fragments dissolving into a single rose color chip
The default marker is not painted by the username. It is folded out of the 128-bit Java UUID until only 24 color bits remain.

The formula at a glance

Java stores a UUID as two 64-bit halves. XOR those halves, XOR the upper and lower 32-bit words, then keep the lowest 24 bits as red, green, and blue.

hilo = mostSignificantBits XOR leastSignificantBits
hash = upper32(hilo) XOR lower32(hilo)
rgb  = hash AND 0x00FFFFFF
hex  = padToSixHexDigits(rgb)

The public Java API documents the most-significant and least-significant bit accessors and the class's hashCode() method. The checker mirrors those fixed-width operations with JavaScript BigInt so ordinary floating-point numbers never round the UUID.

Step-by-step calculation for Notch

StageValueWhat happens
UUID069a79f4-44e9-4726-a5be-fca90e38aaf5Remove dashes, preserving every hexadecimal digit.
MSB069A79F444E94726First 16 hexadecimal digits, or 64 bits.
LSBA5BEFCA90E38AAF5Last 16 hexadecimal digits, or 64 bits.
MSB XOR LSBA324855D4AD1EDD3Combines both UUID halves without losing bits.
32-bit hashE9F5688EXOR the upper and lower 32-bit words.
Low 24 bitsF5688EDrop the highest hash byte.
Result#F5688ERGB 245, 104, 142.

JavaScript implementation

function uuidToColor(uuid) {
  const hex = uuid.replaceAll("-", "");
  const msb = BigInt("0x" + hex.slice(0, 16));
  const lsb = BigInt("0x" + hex.slice(16));
  const hilo = msb ^ lsb;
  const hash = ((hilo >> 32n) ^ hilo) & 0xffffffffn;
  const rgb = Number(hash & 0xffffffn);
  return "#" + rgb.toString(16).padStart(6, "0");
}

BigInt is essential here. JavaScript's regular number type cannot exactly represent every 64-bit integer. Converting the full UUID to a number first can silently change bits and therefore return the wrong color.

Java implementation

UUID uuid = UUID.fromString(input);
int hash = uuid.hashCode();
int rgb = hash & 0x00FFFFFF;
String hex = String.format("#%06X", rgb);
int red = (rgb >>> 16) & 0xFF;
int green = (rgb >>> 8) & 0xFF;
int blue = rgb & 0xFF;

Java's signed int may display the hash as a negative decimal number, but its 32-bit pattern is unchanged. Masking with 0x00FFFFFF deliberately discards the top byte. Unsigned right shift is useful when reading channels, although each channel is masked to eight bits afterward.

Three UUID verification examples

PlayerJava UUIDHashHEXRGB
Notch069a79f4-44e9-4726-a5be-fca90e38aaf5E9F5688E#F5688E245, 104, 142
jeb_853c80ef-3c37-49fd-aa49-938b674adae67408807F#08807F8, 128, 127
Dinnerbone61699b2e-d327-4a01-9f1e-0ea8c3f06bc6EEA0B441#A0B441160, 180, 65

These names are examples, not identity guarantees. A username lookup resolves a current Java UUID first; the color calculation itself uses only the UUID.

Common implementation mistakes

Frequently asked questions

Why does changing a Minecraft username not change the color?

The calculation uses the account UUID, not the visible username. A Java account keeps its UUID through username changes, so the calculated default color stays the same.

Can two UUIDs produce the same Locator Bar color?

Yes. The final color has 24 bits, while a UUID has 128 bits. Many UUIDs must therefore map to the same color, and even different colors may look similar on a small HUD marker.

Why does my in-game marker differ from the calculated default?

Teams and operator commands can override the default indicator color. This page calculates the UUID-derived default, not a server-side override.

Does this calculation work for Bedrock Edition?

No. This implementation uses Java Edition UUIDs and Java UUID.hashCode() behavior. Bedrock accounts use a different identity system.

Look up a color or troubleshoot the HUD

To resolve a Java username or paste a UUID, use the Minecraft Locator Bar Color Checker. For missing markers, the locator_bar game rule, servers, and sneak or invisibility behavior, continue to the Minecraft Locator Bar guide.

Technical references