#FF5733, 00:1A:2B:3C:4D:5E, and IPv6: Three Everyday Hex Formats, Three Different Reasons for Hex
Color codes, MAC addresses, and IPv6 addresses all use hexadecimal β but for different reasons rooted in what each format actually represents. Here's how hex's "two digits per byte" property makes color codes' three-channel structure visible at a glance, why MAC addresses' hex grouping aligns with manufacturer-ID lookups, why IPv6's 128-bit addresses would be unwieldy in decimal, and how the "::" shorthand compresses runs of zero-groups.
By sadiqbd Β· June 15, 2026
Color codes (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), and IPv6 addresses all use hexadecimal β but for completely different reasons, and recognizing why each domain chose hex explains what you're actually looking at when you see one of these strings
The previous articles on this site covered base conversion basics, negative numbers/overflow, bit manipulation, and IEEE 754 floating point. This article looks at three everyday contexts where hexadecimal appears β colors, MAC addresses, and IPv6 β and the different underlying reason hex was the natural choice in each case.
Color codes: hex as a compact representation of three separate byte values
A color like #FF5733 represents three separate values β red, green, and blue components β each ranging from 0-255 (one byte each), as covered in the original base-conversion context: one byte = exactly two hex digits (since 16Β² = 256, covering the full 0-255 range).
#FF5733 breaks down as: FF (red=255), 57 (green=87), 33 (blue=51) β each pair of hex digits represents one color channel's byte value, directly β this pairing is why hex specifically (rather than, say, decimal) became the standard for web colors: #FF5733 instantly shows "three bytes," via its six-character, three-pair structure β a decimal representation (255,87,51) conveys the same information but loses the visual "each pair is one byte" structure that hex's fixed-width, two-digit-per-byte property provides.
Shorthand 3-digit hex colors (#F53, expanding to #FF5533) work by doubling each digit β F β FF, 5 β 55, 3 β 33 β providing a coarser (16 possible values per channel, instead of 256) but more compact representation, useful when the full 256-level precision per channel isn't needed.
MAC addresses: hex as a representation of manufacturer-assigned identifier blocks
A MAC address like 00:1A:2B:3C:4D:5E is a 48-bit (6-byte) identifier β again, naturally expressed as 12 hex digits (6 bytes Γ 2 hex digits each), grouped in pairs separated by colons (or sometimes hyphens) for readability.
The first 24 bits (3 bytes β 00:1A:2B in the example) represent an "Organizationally Unique Identifier" (OUI) β assigned to specific hardware manufacturers by a central registry β the remaining 24 bits (3C:4D:5E) are assigned by that manufacturer, to uniquely identify individual devices they produce.
Why hex specifically, here: beyond the general "bytes map cleanly to hex pairs" reason (shared with colors) β MAC addresses are frequently looked up against OUI databases (to identify a device's manufacturer, from its MAC address) β these databases are indexed by the first 6 hex digits (3 bytes) β hex's byte-aligned structure makes "the first half" of a MAC address a meaningful, directly-extractable unit (the OUI) β a decimal representation wouldn't align as cleanly with this byte-based (and therefore hex-pair-based) structure.
IPv6: hex as a necessity, given the sheer size of the address space
IPv4 addresses (32 bits) are conventionally written in decimal, "dotted-quad" notation (192.168.1.1) β four groups of decimal numbers (0-255 each), separated by dots β each group representing one byte, in decimal.
IPv6 addresses are 128 bits β four times the length of IPv4. Writing a 128-bit number in decimal would produce a very long string of digits (up to 39 decimal digits for the largest possible 128-bit value) β cumbersome and error-prone to read/type.
IPv6 addresses are written in hexadecimal, grouped into eight groups of four hex digits each, separated by colons: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 β each group of 4 hex digits represents 16 bits (since 16^4 = 65536 = 2^16) β 8 groups Γ 16 bits = 128 bits, matching the full address.
Why hex, here, specifically: hex provides the most compact "human-typeable" representation for a 128-bit value, while still aligning cleanly with binary (each hex digit = exactly 4 bits, as covered in the original base-conversion article) β a 128-bit value in hex requires 32 hex digits (plus separators) β considerably shorter than the up-to-39-digit decimal equivalent, while still being directly, simply convertible to/from binary, digit-by-digit (unlike decimal, where converting to/from binary requires more involved arithmetic, as covered in the original base-conversion article).
IPv6's "double colon" shorthand: a separate compression, on top of hex
IPv6 addresses often contain long runs of "0000" groups (many addresses don't use the full 128-bit address space "densely" β significant portions are often zero) β IPv6 notation allows :: to represent one or more consecutive all-zero groups, collapsing them β 2001:0db8:85a3:0000:0000:8a2e:0370:7334 can be written as 2001:db8:85a3::8a2e:370:7334 (the 0000:0000 collapsed to ::, and leading zeros within individual groups, like 0db8 β db8, also dropped).
This :: shorthand can be used only once per address (using it twice would create ambiguity about how many zero-groups each :: represents β the single-use restriction ensures the expansion is always unambiguous, given the known, fixed total of 8 groups).
How to use the Number Base Converter on sadiqbd.com
- For color codes: convert individual hex pairs (
FF,57,33) to decimal to understand each channel's value on the 0-255 scale β or, conversely, convert decimal RGB values to hex pairs to construct a hex color code - For MAC addresses: the OUI (first 3 bytes/6 hex digits) can be looked up against manufacturer-ID databases (external to this tool) to identify a device's manufacturer β this tool helps with understanding/converting the underlying hex/binary values, though the OUI-to-manufacturer mapping itself requires an external database
- For IPv6 addresses: converting individual 4-hex-digit groups to binary (16 bits each) can help understand the underlying bit-level structure of an address, including subnet/network-portion boundaries, which are typically defined in terms of bit-counts
Frequently Asked Questions
Why don't MAC addresses or IPv6 addresses use the 0x prefix that's common for hex numbers in programming?
The 0x prefix (common in programming contexts, indicating "this literal is hexadecimal," as it would otherwise be ambiguous with decimal) is one convention among several for signaling "this is hex" β MAC addresses and IPv6 addresses use their own, distinct formatting conventions (colon-separated groups, for both) β which, given the fixed, well-known structure of these address formats (always colon-separated hex groups, of known group-counts/widths) β don't need an additional "this is hex" marker; the format itself (colon-separated groups of the expected width) is sufficient to signal "these are hex digits" to anyone familiar with the respective address formats β context-specific conventions, rather than a single, universal "hex-marker" convention across all domains.
Is the Number Base Converter free? Yes β completely free, no sign-up required.
Try the Number Base Converter free at sadiqbd.com β convert between binary, octal, decimal, and hexadecimal instantly.