Paste it the way you found it. The 0x, #, $, \x, % and U+ prefixes, a trailing h, and spaces, colons or hyphens between bytes are all read, and every digit stays exact however long the value is.
The same value, every way it is written
Colour and text rows appear only when the digits make sense as oneEnter a value to convert.
Hex you meet in the wild
Each chip loads a real value into the converter: a colour code, a little endian word from a memory dump, a UUID, a file signature, and a number too big for an ordinary JavaScript number to hold exactly.
Read the prefix before the digits
The same four characters mean different things depending on what sits in front of them. The prefix tells you whether you are looking at a number, a colour or a piece of text, and so which row of the converter to read.
| Written as | Example | Where you see it | It is |
|---|---|---|---|
0x prefix | 0x1F4 | C and the languages that borrowed its syntax, such as JavaScript and Python | Number |
h suffix | 0FFh | Intel assembly. A leading 0 is added when the first digit is a letter | Number |
$ prefix | $1F4 | 6502 and Motorola assembly, Pascal, Delphi, Commodore BASIC | Number |
# prefix | #FF6C00 | CSS and HTML colours, in 3, 4, 6 or 8 digit forms | Colour |
U+ prefix | U+00E9 | Unicode code points, at least four digits | Text |
&#x and ; | é | HTML and XML character references | Text |
\x escape | \xC3\xA9 | String literals in C, Python and JavaScript, one byte per escape | Text |
% escape | %C3%A9 | URL percent encoding, one byte per escape | Text |
| Colons or hyphens | 01-23-45-67-89-AB | MAC addresses, six bytes; IPv6 uses colons and lowercase | Address |
| Hex | Decimal | Why it is worth recognising | Size |
|---|---|---|---|
FF | 255 | The largest value one byte holds, and the brightest channel in a colour | 1 byte |
100 | 256 | One more than FF: the count of values a byte can take | 2 bytes |
FFFF | 65,535 | The largest unsigned 16 bit number, and one IPv6 group | 2 bytes |
10FFFF | 1,114,111 | The highest code point Unicode allows | 3 bytes |
7FFFFFFF | 2,147,483,647 | The largest signed 32 bit integer | 4 bytes |
FFFFFFFF | 4,294,967,295 | The largest unsigned 32 bit integer | 4 bytes |
DEADBEEF | 3,735,928,559 | Hexspeak: a marker value debuggers write into memory so it stands out in a dump | 4 bytes |
CAFEBABE | 3,405,691,582 | The first four bytes of every Java class file | 4 bytes |
1FFFFFFFFFFFFF | 9,007,199,254,740,991 | The last integer a JavaScript number stores exactly; past it, converters without BigInt round | 7 bytes |
FFFFFFFFFFFFFFFF | 18,446,744,073,709,551,615 | The largest unsigned 64 bit integer | 8 bytes |
Hex converter guide: base 16, bytes, colours and text
How hexadecimal works, why computers write in it, and how to read the prefixes, byte orders and encodings that surround it.
A hex converter earns its keep when you do not yet know what the hex in front of you is. Is 1F4 a number, the short colour #1F4, or two bytes copied backwards out of a memory dump? This one does not make you decide first. Type or paste the value once and every reading comes out together: hexadecimal, decimal, binary, octal, the byte count, both byte orders, the colour when the digits form one, the text when the bytes decode as UTF-8, and a hex dump. All of the arithmetic runs in BigInt, so a 128 bit UUID converts as exactly as a single byte.
How hexadecimal works
Hexadecimal is base 16. It counts 0 to 9 the way decimal does, then carries on with A, B, C, D, E and F for ten to fifteen, so a single hex digit holds sixteen values. Each place is worth sixteen times the place to its right.
| Place | Power | Worth in decimal |
|---|---|---|
| 1st from the right | 160 | 1 |
| 2nd | 161 | 16 |
| 3rd | 162 | 256 |
| 4th | 163 | 4,096 |
| 5th | 164 | 65,536 |
| 6th | 165 | 1,048,576 |
To convert hex to decimal, multiply each digit by its place value and add the results. 1F4 is 1 × 256 + 15 × 16 + 4 × 1, which is 256 + 240 + 4, or 500. The same method gives 3B = 59, 2AA = 682 and E7A9 = 59,305. Upper and lower case letters mean the same thing, so 1f4 and 1F4 are one number.
To convert decimal to hex, divide by 16, write down the remainder, and repeat on the quotient until nothing is left. 500 ÷ 16 is 31 remainder 4, 31 ÷ 16 is 1 remainder 15, which is F, and 1 ÷ 16 is 0 remainder 1. Read the remainders from the bottom up and you have 1F4. The working panel under the ladder prints the right method for whatever you enter, digit by digit.
Why computers write numbers in hex
Sixteen is two to the fourth power, so one hex digit stands for exactly four bits, a unit called a nibble, and two hex digits make exactly one byte. The fit is perfect: FF is the largest value a byte holds, 255, and the number after it, 100, is 256. Binary spells that same byte as 11111111, eight characters that are easy to miscount, and decimal needs one to three digits that never line up with byte boundaries. Hex is the shortest notation that still shows where every byte starts and ends, which is why memory addresses, hashes, colour codes and network addresses are all written in it. When you need to see or flip individual bits, or work out how a negative number is stored, the binary converter spells out every one.
Read the prefix before the digits
Hex digits look like decimal digits, so written hex nearly always carries a marker. 0x is the C convention, kept by JavaScript, Python and most languages that borrowed C's syntax. Intel assembly puts an h after the number and adds a leading 0 when the first digit is a letter, as in 0FFh. 6502 and Motorola assembly, Pascal and Delphi put a $ in front. Ada and VHDL wrap the digits as 16#5A3#. A # in front means a colour in CSS or HTML. U+ marks a Unicode code point, &#x and a closing semicolon make an HTML character reference, \x marks one byte inside a string literal, and % marks one byte in a URL. The converter strips all of these, along with spaces, colons and hyphens between bytes, so you can paste a value exactly as you found it. The reference table above sorts the prefixes by what they tell you: a number, a colour, text or an address.
Hex colour codes
A CSS hex colour is three bytes, red, green and blue, each from 00 to FF. #FF6C00 is rgb(255 108 0): full red, a little under half green and no blue, a strong orange. Six digits give 16,777,216 possible colours. Two other lengths are easy to misread. Three digits double each one, so #F09 is #FF0099 and #123 is #112233, not #010203. Four and eight digits add an alpha channel on the end, where 00 is fully transparent and FF fully opaque. In the middle of the 1990s, when many screens showed only 256 colours, designers kept to a web safe palette built from the steps 00, 33, 66, 99, CC and FF, 216 colours in all.
Whenever the hex you type has 3, 4, 6 or 8 digits the converter adds a colour row with a swatch and the rgb() values. That is why the default value, 1F4, shows up as a vivid green: read as a colour, #1F4 is #11FF44. To pick a colour or look one up by name rather than decode one, use the RGB Color Codes tool.
Text to hex, and hex back to text
Text only becomes hex through an encoding, and on the web that encoding is UTF-8: W3Techs counted it on 99.1% of the websites whose encoding it could identify in September 2026. UTF-8 stores each of the 128 ASCII characters in one byte with the same value ASCII gives it, so H is 48, e is 65 and Hello is 48 65 6C 6C 6F. Every other character takes two, three or four bytes. é is code point U+00E9 and is stored as C3 A9; £ is C2 A3; € is E2 82 AC. So a word with an accent has more bytes than letters, and a program that wrongly reads one byte per character turns café into café.
Switch Read it as to Text and the ladder shows the UTF-8 bytes, the Unicode code points, the same bytes as \x and % escapes, and a hex dump. In hex mode the converter tries the reverse on every value and adds an As text row only when the bytes form valid, printable UTF-8, so an ordinary number never turns into a line of junk characters. For the full chart of the 128 ASCII codes, see the ASCII table.
Byte order: why memory dumps look backwards
A number wider than one byte has to be laid out in memory one byte at a time, and machines disagree about which end goes first. Big endian puts the most significant byte first, the way people write numbers. Little endian puts the least significant byte first. The 32 bit value 0x0A0B0C0D sits in memory as 0A 0B 0C 0D on a big endian machine and as 0D 0C 0B 0A on a little endian one. x86, x86-64 and most ARM systems are little endian, while Internet protocols send the big end first, which is why big endian is also called network byte order. Danny Cohen introduced the names in 1980, taking them from the two factions in Gulliver's Travels that argue over which end of an egg to crack.
In practice this means that when a debugger shows F4 01 00 00 at an address, the number stored there is 0x000001F4, which is 500. Set Byte order typed to little endian, paste the bytes as they appear, and the converter reverses them before it converts. The ladder always prints both orders, and Pad to width fills a value out to 8, 16, 32, 64 or 128 bits so you can see it laid out the way a register or a struct field would hold it.
Long values stay exact
A converter built on ordinary JavaScript numbers holds whole numbers exactly only up to 9,007,199,254,740,991, 2 to the 53rd power minus 1, written 1FFFFFFFFFFFFF in hex. Above that, some integers simply cannot be stored and the tool quietly hands back a neighbour: 9,007,199,254,740,993 comes back as 9,007,199,254,740,992. Other tools refuse long input outright; one popular pair of converters stops at 16 hex characters and 19 decimal digits, the 64 bit ceiling. This page uses BigInt, whole numbers with no fixed size, so a 32 digit UUID, a 64 character SHA-256 hash or a 40 character Ethereum address converts digit for digit.
Identifiers written in hex
Several everyday identifiers are simply long numbers written in hex with fixed grouping. A UUID is 128 bits, written as 32 hex digits in groups of 8, 4, 4, 4 and 12, 36 characters with the hyphens; RFC 9562 replaced RFC 4122 as its specification in May 2024. A MAC address is 48 bits, six pairs of hex digits separated by colons or hyphens, and the first three pairs identify the manufacturer. An IPv6 address is 128 bits in eight groups of four hex digits, and its standard text form uses lowercase letters, drops leading zeros and shortens the longest run of zero groups to a double colon. Paste a UUID or a MAC address straight in and the separators are ignored, so you see the identifier as one number and as its bytes. For IPv6, write every group out as four digits first, because the shortened form leaves out zeros the converter cannot guess.
Hex dumps and file signatures
A hex dump shows raw bytes as text: an offset on the left, usually 16 bytes per line in hex, and on the right the same bytes as characters, with anything outside the printable range 20 to 7E shown as a dot. The Unix tools xxd, hexdump and od all print this layout, and the converter adds a dump to the ladder for any value of four bytes or more. Dumps are how you recognise a file from its first few bytes, its signature or magic number. A PNG image begins 89 50 4E 47 0D 0A 1A 0A, with the letters PNG readable in the dump. A PDF begins 25 50 44 46 2D, which reads %PDF-. A ZIP archive begins 50 4B 03 04, PK. ELF programs on Linux begin 7F 45 4C 46, and Java class files begin CA FE BA BE.
What this converter leaves to other tools
It converts whole numbers and bytes. Hex fractions exist, 0.8 is one half because 8 is half of 16, but they are rare outside the classroom. Floating point values are stored in their own IEEE 754 bit layout, so the hex of a float is not the hex of the whole number it looks like; a float converter is the right tool there. Adding and subtracting in hex, where a borrowed 1 is worth 16 rather than 10, is a job for a hex calculator. Negative numbers keep their minus sign here, and how a machine stores them in a fixed width, two's complement, is covered on the binary converter.
Frequently Asked Questions
Why do the bytes in a memory dump look backwards next to the number?
Because most machines you will debug on are little endian. x86, x86-64 and most ARM chips store the least significant byte at the lowest address, so the 32 bit value 500, 0x000001F4, appears in memory as F4 01 00 00. The dump is read left to right, so the bytes look reversed, but nothing is wrong with the data. Paste the bytes as shown, set Byte order typed to little endian, and the converter reverses them before converting. Internet protocols do the opposite and send the most significant byte first, which is why big endian is also called network byte order.
Why do some hex converters get long values wrong?
A converter built on the ordinary JavaScript number type stores whole numbers exactly only up to 9,007,199,254,740,991, which is 1FFFFFFFFFFFFF in hex, or 53 bits. Past that point some integers cannot be represented, so the tool quietly returns a nearby value: 9,007,199,254,740,993 comes back as 9,007,199,254,740,992. Other tools refuse anything longer than 16 hex digits. This converter uses BigInt, which has no fixed size, so a 128 bit UUID or a 256 bit hash converts exactly, digit for digit.
How do I expand a three digit hex colour like #F09?
Double every digit. #F09 becomes #FF0099, which is rgb(255 0 153), and #123 becomes #112233, not #010203. The four digit form works the same way with an alpha digit on the end, so #F09A becomes #FF0099AA. Type any 3, 4, 6 or 8 digit value in hex mode and the converter shows the expanded code, the rgb() values and a swatch. That is also why a plain number such as 1F4 gets a colour row: read as a colour, it is #11FF44. To choose a colour rather than decode one, the RGB Color Codes tool has a picker.
Why does a letter like é turn into two hex bytes?
Because text is stored as UTF-8, which gives each character between one and four bytes. The 128 ASCII characters, English letters, digits and common punctuation, take one byte each, so A is 41. Anything beyond them needs more: é is code point U+00E9 and is stored as C3 A9, £ as C2 A3, and € as E2 82 AC, three bytes. If a program reads those bytes one per character in an older encoding, é shows up as é, the classic sign of text decoded with the wrong encoding. Text mode on this page lists each character's code point next to its bytes.
Why does hexadecimal use the letters A to F?
Base 16 needs six extra symbols for ten to fifteen, and early machines did not agree on them. The SWAC in 1950 and the Bendix G-15 in 1956 used the lowercase letters u, v, w, x, y and z. A to F became the de facto standard from 1966, after IBM published its Fortran IV manual for the System/360, and mainstream languages and tools have used them ever since. Case does not change the value: 1f4 and 1F4 are the same number, although IPv6 addresses are written in lowercase by rule.
How many hex digits are in a UUID, a MAC address and an IPv6 address?
A UUID is 128 bits, so 32 hex digits, written in groups of 8, 4, 4, 4 and 12 with four hyphens, 36 characters in all. A MAC address is 48 bits, 12 hex digits in six pairs. An IPv6 address is also 128 bits, 32 hex digits in eight groups of four, although the usual written form drops leading zeros and squeezes the longest run of zero groups into a double colon. Each hex digit is 4 bits, so the digit count times 4 always gives the size in bits. A SHA-256 hash is 32 bytes, which is why it is always 64 hex digits long.
How can I tell whether 10 means ten or sixteen?
Only from a prefix or from context, because the digits alone cannot tell you: 10 is ten in decimal, sixteen in hex, eight in octal and two in binary. That is why written hex almost always carries a marker, 0x10 in code, 10h in Intel assembly, $10 in 6502 assembly, or a # in front of a colour. A value containing any of the letters A to F is certainly not decimal. When you paste a number with no marker, choose the base in Read it as rather than guessing; the ladder then shows it in every other base, so a wrong guess is obvious straight away.