Hex Converter

Paste a hexadecimal number — get its decimal and binary forms. Paste a hex colour and get its RGB values with a live preview.

Hexadecimal—
Decimal—
Binary—

Hex to text and text to hex: every character is one byte, written as two hex digits.

How to use it

Paste your hex — a number like 2A or a colour like #FF6A3D.
Read the conversions — decimal and binary appear instantly.
See the colour when your hex is six digits: the swatch shows exactly what that code looks like.

Hex is everywhere once you look

Memory addresses, colour codes, Unicode points, network packets, error codes — hexadecimal is the notation technical work runs on, because it is binary you can actually read. Two hex digits are one byte; that is why colours are six digits (three bytes: red, green, blue) and why "0x" prefixes mark numbers as hex in code. This converter handles the number side and the colour side together, so the abstract digit-string becomes something you can see.

Hex to RGB, explained

A hex colour is three bytes in a row: the six digits split into red, green and blue pairs, and each pair is a number from 0 to 255 written in base 16. Read #3D85C6 as 3D (61) red, 85 (133) green, C6 (198) blue — rgb(61, 133, 198). That is the whole trick: once you can convert one pair, you can read any colour code on the web. The converter above does it for you and shows the colour itself.

HexDecimalWhere you meet it
0A10The first letter-digit, A, in action
1016One full set of hex digits
64100A round hundred
FF255The biggest one-byte value; a full colour channel
100256One past the one-byte limit
3E81000A round thousand
#FF0000rgb(255, 0, 0)Pure red
#00FF00rgb(0, 255, 0)Lime green
#0000FFrgb(0, 0, 255)Pure blue
#808080rgb(128, 128, 128)Mid grey — every channel at half
#FFFFFFrgb(255, 255, 255)White — every channel full

Two habits make hex effortless. First, learn the landmarks: 00 is nothing, 80 is half (128), FF is everything (255) — most colour pairs you meet sit between those. Second, remember that hex counts in sixteens, so 20 is not twenty but thirty-two, and 99 is not ninety-nine but one hundred and fifty-three. Convert a few by hand with the place-value method in the FAQ and the notation stops looking like a secret code.

Going the other way: RGB to hex

Design tools usually show colours as RGB numbers, while CSS wants the hex code. Our Color Converter converts between HEX, RGB and HSL live, with a preview swatch — the natural partner to this page. Between the two, every direction of the hex, decimal, binary and colour journey is covered, free and in your browser.

Hex to text — and text to hex

Computers store text as bytes, and hex is how bytes get written down. Each character is one byte, and each byte is exactly two hex digits: H is 48, e is 65, l is 6C, l is 6C, o is 6F — so "Hello" written as data is 48656C6C6F. That is why hex text always has an even number of digits, and why spaces in a hex string are only there for human eyes.

You meet hex-encoded text in CTF puzzles and coding challenges, in network tools showing raw packet contents, in file signatures (a PNG file begins with the bytes 89 50 4E 47 — the 50 4E 47 is literally "PNG"), and in old email and URL encodings. The second panel on this page converts both ways live: paste a hex string to read it as text, or type text to see its bytes. Characters outside plain ASCII are handled properly too — they are written as their UTF-8 bytes, which is how the modern web stores them.

Sixteen digits: where programmers and colours meet

Hexadecimal is base sixteen — digits 0–9 plus letters A–F standing for ten through fifteen — and it exists for one elegant reason: sixteen is two to the fourth power, so exactly four binary digits make one hex digit, making hex the compact human handwriting for binary data. A byte, eight bits, is always exactly two hex digits, from 00 to FF. This converter moves between hex, decimal and binary in every direction, so the same value can be read in whichever base the job speaks.

Its two great workplaces reward fluency in both. In computing, hex is the language of memory addresses, error codes, machine-level data and network hardware — your router's MAC address is six hex bytes wearing colons. In design, the same notation paints the web: a colour like #FF5733 is three hex bytes, one per channel — red at FF (255, full), green at 57 (87), blue at 33 (51) — and this converter shows the RGB breakdown alongside, bridging the programmer's base and the designer's palette. Two habits make hex effortless: learn the landmarks (00 is nothing, 80 is exactly half, FF is everything), and remember that hex counts in sixteens, so 20 is thirty-two and 99 is one hundred and fifty-three.

Values are converted on your device, both ways, with the workings available. However the number arrived — an address, an error, a colour — it leaves readable.

Questions, answered

What is hexadecimal?

A base-16 number system: digits 0–9 then A–F (where A=10 through F=15). Programmers use it because each hex digit is exactly 4 binary bits — two hex digits make one byte.

Why do web colours use hex?

A colour like #FF6A3D is three bytes — red, green, blue — written as six hex digits. It is compact, exact, and every browser and design tool understands it.

Can I include the 0x or # prefix?

Yes. Both are stripped before conversion, so 0xFF, #FF and FF all mean the same thing here.

How do I convert hex to decimal by hand?

Multiply each digit by its place value — powers of 16 — and add. For example, 0x2A = 2×16 + 10 = 42.

Rate this tool

Related tools