Numbers · base 16Hexadecimal numbers

Convert a number to hex and back. Type a value in any base — you get the others, a digit-by-digit breakdown and the nibbles every digit unfolds into.

Everything is computed in your browser — nothing is sent to a server
01Convert02Digit lanes03Bytes and colour04Table05About base 1606Questions
01

Convert

type a number in any base
Input · decimal
Common values
Notation
Result
Hexadecimal
FF
Decimal255
Octal377
Binary1111 1111
Hex digits2
How big it isone byte
Fits in 8 bits: the range 0–255, that is 00–FF.
02

Digit lanes

step the digits with the arrows — the number changes as you go
F16¹15 × 16
F16⁰ = 115 × 1
255
in decimal

Every digit is a value multiplied by a power of sixteen; the sum of those products is the number. Under each digit is its nibble: the four bits it unfolds into with no arithmetic. That is why hex and binary convert digit by digit.

03

Bytes and colour

two hex digits make one byte
Byte breakdown
FF25511111111outside ASCII

One byte is two hex digits. Next to it you see the value in decimal and in bits.

It is also a colour

Hex becomes a colour when it has three, six or eight digits — one byte per channel. Right now there are 2.

Loads #0000FF — the same number padded with zeros on the left.

04

Conversion table

click a row to load the value
DecimalHEXOCTBinaryWhat is notable
88101000one digit · three bits
10A121010the first letter — A
15F171111largest single digit
16102010000start of the second digit
64401001000000power of two
100641441100100round in decimal
1288020010000000top bit of a byte
255FF37711111111largest single byte
256100400100000000two bytes, start
1024400200010000000000kilobyte
4095FFF7777111111111111three digits at their limit
65535FFFF1777771111111111111111largest two bytes
05

About hexadecimal

Hexadecimal is for places where bits matter. One digit is exactly four bits, so a byte is always two digits and converting to binary needs no division: every digit simply unfolds into its nibble. Values from ten to fifteen are written as the letters A–F.

One digit is four bits

Nibble
F = 1111
Sixteen is two to the fourth power, so a hex digit covers exactly four bits. Conversion to binary goes digit by digit, with no division.

A byte is two digits

Byte
00 … FF
Eight bits are written as two hex digits: values from 0 to 255. That is why memory dumps and colours are read in pairs.

The letters A–F

Digits
A=10 · F=15
There are only ten familiar digits, and sixteen are needed. Values 10–15 are written as letters; case does not affect the value.

Notation prefixes

Syntax
0xFF · #FF · FFh
In code it is 0x, in colours a hash sign, in assembly the h suffix. It is the same notation, only the marker differs.

Colours

In practice
#FF00AA
Six digits are three one-byte channels: red, green and blue. Three digits are the same thing in short form, with every digit doubled. Eight digits add a fourth byte — the alpha channel.

Where else you meet it

In practice
MAC · UUID · Unicode
MAC addresses, UUIDs, Unicode code points, memory dumps, checksums — everywhere it helps to see the bits without reading binary.
06

Frequently asked questions

255 in decimal is FF in hexadecimal (0xFF). It is the largest value of a single byte: two hex digits cover exactly 8 bits.

Works with non-negative integers of any length. Fractional and negative values are not supported.

«» added to favorites