Conversion

Decimal to Hexadecimal

Convert a decimal number to hexadecimal, binary and octal, with byte size and 0x-prefixed notation.

How it works

Hexadecimal is everywhere in computing: MAC addresses, IPv6 addresses, colours, VLAN registers. Each hexadecimal digit represents 4 bits, which makes binary much more compact to read.

65535 = 0xFFFF, the largest 16-bit number — the maximum value of a TCP/UDP port or of a 12-bit VLAN (0x0FFF = 4095).

Examples

Maximum port

0xFFFF.

value65535
Load this example

Maximum VLAN

0xFFE.

value4094
Load this example

Frequently asked questions

Why use hexadecimal rather than decimal?

Because it converts directly to binary: each hexadecimal digit corresponds to exactly 4 bits.

How do you read 0x1F?

0x indicates hexadecimal: 1F = 1×16 + 15 = 31 in decimal.