|

Hexadecimal Decode

Enter a hexadecimal string and the tool decodes it into decimal, binary, octal, readable text, and — for 8 hex digits — a 32-bit float.

Digits 0-9 and letters A-F only. A leading 0x is fine, and so are spaces or commas between byte pairs. The value needs an even number of digits, because text is read two digits at a time, one byte per pair.

Common hex values
HexDecimalBinaryMeans
0000000 0000Zero, one empty byte
0A100000 1010First letter digit
0F150000 1111Largest single hex digit
10160001 0000Hex “ten”
20320010 0000Space character
41650100 0001Letter A
641000110 0100Decimal 100
7F1270111 1111Largest ASCII code
801281000 0000First byte above ASCII
FF2551111 1111Largest value of one byte
01002560000 0001 0000 000016 squared
FFFF65,5351111 1111 1111 1111Largest value of two bytes
FFFFFFFF4,294,967,2951111 1111 1111 1111 1111 1111 1111 1111Largest unsigned 32-bit value

Your entries stay in your browser. Nothing is uploaded or stored.

Hexadecimal decode means reading a base-16 value back into the forms people actually use: its decimal number, its binary digits, its octal digits, the text its bytes spell out, and, for four bytes, the decimal number it stores as a 32-bit float. The tool above does all five readings at once from a single hex string.

How do I decode a hexadecimal string?

Type or paste your hex value into the box and press Decode. The tool accepts the digits 0-9 and the letters A-F in either upper or lower case, with or without a leading 0x, and it ignores spaces or commas between byte pairs, so 48656C6C6F, 48 65 6C 6C 6F and 0x48656C6C6F all give the same answer. The results appear in labelled boxes: decimal first, then octal, then the full binary form, then the decoded text, then the 32-bit float reading when the input is exactly 8 hex digits long. A short note under the boxes tells you how many bytes and bits the value holds.

If something is wrong with the input, the tool says so in plain language instead of guessing. An empty box asks you to enter a value first. A character outside 0-9 and A-F is named in the message, so you can see at once which character broke it. An odd number of digits is refused, with the advice to add a leading zero, because the text reading works in pairs and a lone final digit has no partner. Values longer than 64 hex digits are refused too, since the tool is built for values up to 32 bytes. None of these errors change your input; correct it and press Decode again.

The tool also accepts lower-case input without complaint, because case carries no meaning in hexadecimal: ff, FF and 0xFf are all 255. That matters when you copy a value out of code or a log file, where the case depends on whoever wrote it. The tool normalises the case for you and shows the cleaned-up hex in the note under the results, so you can check that what it read matches what you pasted.

What is hexadecimal, and why does it use letters?

Hexadecimal is a base-16 number system. Ordinary decimal is base 10, so it needs ten symbols, 0 to 9. Hexadecimal needs sixteen symbols, and it borrows six letters for the six values beyond 9: A stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. Each position in a hex number is worth sixteen times the position to its right, just as each decimal position is worth ten times the one to its right. The place values from the right are 1, 16, 256, 4096, 65536, and so on, each one sixteen times the last.

The reason computers use hex at all is that it lines up neatly with binary. One hex digit is exactly four bits, and two hex digits are exactly one byte. That makes hex a compact shorthand for binary: the byte 1111 1111 is FF, and the byte 0100 1000 is 48. A long binary number that would take forty characters to write takes ten in hex. Programmers, network engineers and anyone reading a memory dump therefore meet hex constantly, and being able to read it back into decimal or text is a practical skill rather than a classroom exercise.

Hex also shows up in places you may already have seen without noticing. Colours on web pages are written in hex, with two digits each for red, green and blue, so FF0000 is pure red and 000000 is black. Internet addresses in the IPv6 format are written as groups of hex digits. Characters in web addresses are sometimes written as a percent sign followed by two hex digits, which is how a space becomes %20. File formats often begin with a fixed hex signature, and the famous example CAFEBABE, which is 3,405,691,582 in decimal, opens Java class files. All of these are the same idea: hex as a compact way to write bytes.

Designed illustration of hexadecimal decoding: the hex string 48656C6C6F shown as five byte pairs above the decoded word Hello, with its decimal value 310939249775 and binary form, on a dark teal background with amber hex-digit accents.

What does a worked example look like?

Start with the shortest useful example, FF. Each F is worth 15. The right-hand F sits in the ones place, so it is worth 15 times 1, which is 15. The left-hand F sits in the sixteens place, so it is worth 15 times 16, which is 240. Adding them gives 255. In binary, each F is four ones, so FF is 1111 1111. In octal it is 377. As a single byte it is the largest value one byte can hold, which is why FF turns up so often in computing.

Now take a longer value, 48656C6C6F, and read it as text. Split it into pairs: 48, 65, 6C, 6C, 6F. Each pair is one byte, and each byte is one character. The pair 48 is 72 in decimal, and character 72 in the ASCII table is the capital letter H. The pair 65 is 101, which is a lower-case e. The pair 6C is 108, which is a lower-case l, and it appears twice. The pair 6F is 111, which is a lower-case o. Put together, the five bytes spell “Hello”. The tool gives the same answer, and it also gives the value as a plain number: 310,939,249,775 in decimal, 0100 1000 0110 0101 0110 1100 0110 1100 0110 1111 in binary, and 4414533066157 in octal. That is five bytes, or forty bits.

A third example shows the float reading. The eight hex digits 3F800000 decode as the 32-bit float 1. The tool breaks the bits down as well: sign 0, exponent 127, mantissa 0. The exponent 127 means an exponent of zero once the fixed offset of 127 is subtracted, so the value is 2 to the power of 0, which is 1, times a mantissa of exactly 1. The same input as a plain number is 1,065,353,216 in decimal, which shows how different the float reading is from the ordinary number reading: the same four bytes mean two completely different things depending on how they are read.

A fourth example shows a float that is not a round number. The hex value 40490FDB reads as the float 3.1415927410125732, which is the closest a 32-bit float can get to pi. Its parts are sign 0, exponent 128 and mantissa 4,788,187. The exponent 128 means 2 to the power of 1, and the mantissa works out to 1.5707963705062866, so 2 times 1.5707963705062866 gives 3.1415927410125732. The small difference from pi itself is not a mistake: a 32-bit float holds about seven decimal digits of precision, and pi needs more than that, so the stored value is the nearest one the format can hold.

What are the most common hex values?

Some hex values appear so often that they are worth recognising at a glance. The table below lists them with their decimal, binary and octal forms, every cell produced by the same arithmetic the tool uses. The pattern to notice is the powers of sixteen: 10 in hex is 16, 100 in hex is 256, 1000 in hex is 4096, and each step multiplies by sixteen again.

HexDecimalBinaryOctalWorth knowing
0000000 00000Zero, one empty byte
0A100000 101012First letter digit
0F150000 111117Largest single hex digit
10160001 000020Hex “ten”
20320010 000040Space character
30480011 000060Digit zero
41650100 0001101Letter A
61970110 0001141Letter a
641000110 0100144Decimal 100
7F1270111 1111177Largest ASCII code
801281000 0000200First byte above ASCII
FF2551111 1111377Largest value of one byte
01002560000 0001 0000 000040016 squared
04001,0240000 0100 0000 00002000One kilobyte in bytes
10004,0960001 0000 0000 00001000016 cubed
FFFF65,5351111 1111 1111 1111177777Largest value of two bytes
FFFFFF16,777,2151111 1111 1111 1111 1111 111177777777Largest value of three bytes
7FFFFFFF2,147,483,6470111 1111 1111 1111 1111 1111 1111 111117777777777Largest signed 32-bit integer
FFFFFFFF4,294,967,2951111 1111 1111 1111 1111 1111 1111 111137777777777Largest unsigned 32-bit value
DEADBEEF3,735,928,5591101 1110 1010 1101 1011 1110 1110 111133653337357A well-known test value

Two rows deserve a closer look. The value 7FFFFFFF, 2,147,483,647, is the largest number a signed 32-bit integer can hold, and it appears as a limit in many programs and databases. The value DEADBEEF, 3,735,928,559, is a favourite test value among programmers because its hex digits spell a word, which makes it easy to spot in a memory dump. Neither value is special to this tool; they are part of the shared vocabulary of computing, and recognising them saves time when they appear in someone else’s code.

How do hex bytes become readable text?

Text is stored in computers as numbers, and hexadecimal is simply a way of writing those numbers down. The ASCII table gives each character a number: a space is 32, the digit 0 is 48, the capital letter A is 65, and the lower-case letter a is 97. To turn text into hex, you write each character’s number in two hex digits. To decode hex back into text, you reverse the process: split the hex into pairs, turn each pair into its number, and look up the character.

The word “Hello” is the standard example, and the arithmetic is short enough to check by hand. H is 72, and 72 divided by 16 is 4 with a remainder of 8, so H is 48 in hex. The letter e is 101, and 101 divided by 16 is 6 with a remainder of 5, so e is 65. The letter l is 108, and 108 divided by 16 is 6 with a remainder of 12, and 12 is C, so l is 6C. The letter o is 111, and 111 divided by 16 is 6 with a remainder of 15, and 15 is F, so o is 6F. Reading the pairs in order gives 48 65 6C 6C 6F, which is the input the tool decodes back to “Hello”.

Not every byte is a readable character. Bytes from 32 to 126 are the printable characters: letters, digits, punctuation and the space. Bytes below 32 are control codes, such as the newline and the tab, and byte 127 is the delete code. Bytes from 128 to 255 fall outside the original ASCII table and belong to other character sets. The tool shows printable bytes as their characters and shows any other byte in square brackets with its hex pair, for example [00] for a zero byte, so that nothing is silently hidden. A single FF on its own therefore reads as [FF], not as a blank, because byte 255 is not a printable ASCII character.

There is one more point worth knowing about text and hex. Modern text is usually stored as UTF-8, in which ordinary English letters take one byte each, exactly as in ASCII, while accented letters and symbols take two, three or four bytes. The byte pairs still decode the same way, but a multi-byte character only appears correctly when all of its bytes are present. The Bitwise Calculator on this site works with the same binary ideas at the level of single numbers, if you want to see how individual bits combine.

How do I read hex as binary or octal?

Hex and binary translate digit by digit, with no arithmetic at all, because one hex digit is exactly four bits. The digit 0 is 0000, 1 is 0001, 2 is 0010, 3 is 0011, 4 is 0100, 5 is 0101, 6 is 0110, 7 is 0111, 8 is 1000, 9 is 1001, A is 1010, B is 1011, C is 1100, D is 1101, E is 1110, and F is 1111. To turn a hex value into binary, replace each digit with its four bits. The value 2F becomes 0010 1111, and FF becomes 1111 1111. To go the other way, split the binary into groups of four from the right and replace each group with its hex digit. The binary number 1101 1010 splits into 1101 and 1010, which are D and A, so it is DA in hex.

Octal works the same way but in groups of three bits, because one octal digit is three bits. The cleanest route from hex to octal is through binary: turn the hex into binary, regroup the bits in threes from the right, and read off the octal digits. The hex value FF is 1111 1111 in binary, which regroups as 11 111 111, giving 377 in octal once the leading group is read as 3. The tool does this regrouping for you and shows the octal result alongside the binary, so you can check the working in either direction.

Doing one conversion by hand is worth the effort, because it shows why hex exists. The decimal number 47 is 2F in hex, 101111 in binary, and 57 in octal. The hex form is the shortest to write and the easiest to read, the binary form shows exactly what the bits are, and the octal form sits in between. Each form is the same number; only the writing changes.

What does a hex value mean as a 32-bit float?

A 32-bit float is the way most programs store a decimal number in four bytes, following the IEEE 754 standard. The 32 bits are split into three parts: one sign bit, eight exponent bits, and twenty-three mantissa bits. The sign bit is 0 for a positive number and 1 for a negative one. The exponent bits hold the power of two, with 127 added so that small exponents stay positive. The mantissa bits hold the digits after the leading 1 of the number, written in binary.

The value 3F800000 is the clearest example. Its bits split into sign 0, exponent 127 and mantissa 0. Subtracting 127 from the exponent gives 0, so the value is 2 to the power of 0, which is 1, times a mantissa of 1, giving 1. The value C0000000 splits into sign 1, exponent 128 and mantissa 0, so it is minus 2 to the power of 1, which is -2. The value 42C80000 splits into sign 0, exponent 133 and mantissa 4,718,592, and works out to 100. The float reading only appears when the input is exactly eight hex digits, because a 32-bit float is exactly four bytes; a shorter or longer value has no single float reading.

Some bit patterns do not behave like ordinary numbers, and the tool shows them as they are. The pattern 7F800000 has exponent 255 and mantissa 0, which the standard reads as Infinity. The pattern FF800000 is the same with the sign bit set, so it reads as -Infinity. The pattern 7FC00000 has exponent 255 and a non-zero mantissa, 4,194,304, which the standard reads as NaN, meaning not a number. These patterns appear when a program divides by zero or works with a value that has no numeric answer, and recognising them in a hex dump tells you at once that something went wrong upstream. The smallest positive value the format can hold, 1.401298464324817e-45, comes from the pattern 00000001, with sign 0, exponent 0 and mantissa 1.

Why did the tool reject my hex value?

There are four reasons, and each one has a plain fix. An empty box simply needs a value typed in. A character outside 0-9 and A-F, such as G or Z, is not a hex digit, and the message names the character so you can find it; this often happens when a value is copied from a page that includes a label or a colon. An odd number of digits is refused because the text reading works in pairs, and the fix is to add a leading zero, which does not change the number: ABC becomes 0ABC, and 0ABC decodes to the same decimal value as ABC would, with the bytes 0A and BC. A value longer than 64 hex digits is refused because the tool is built for values up to 32 bytes; a longer dump is better handled in chunks.

One mistake is worth a special mention, because it looks like a tool error and is not. If you paste a value that includes a 0x prefix in the middle, such as 0x48 0x65, the tool removes spaces first and then reads the first 0x as the prefix, but the second 0x leaves an x in the middle of the string, and x is not a hex digit. The fix is to remove the extra prefixes before pasting, or to paste the plain digits. The same applies to values copied from code that use a \x escape before each byte: strip the escapes and keep the digits.

Where will I meet hexadecimal in real life?

The most common meeting place is the web. Colours in stylesheets and design tools are written as six hex digits, two each for red, green and blue, so FF0000 is red, 00FF00 is green, 0000FF is blue, and FFFFFF is white. Characters in web addresses are percent-encoded with hex, which is why a space in a link becomes %20 and an ampersand becomes %26; the URL Encoder on this site shows that encoding at work. Internet addresses in IPv6 are written as eight groups of hex digits, and the IP Subnetting Calculator works with the same addressing ideas for the older IPv4 format.

Programmers meet hex in debuggers and log files, where memory contents and error codes are printed in hex because it is shorter than binary and closer to the machine than decimal. A crash log might show an address such as 0x7FFF5FBFF8C0, and a file’s first bytes might read 89 50 4E 47, which is the signature of a PNG image. Hardware manuals list register addresses in hex, and colour pickers in every design program show hex codes beside their sliders. Even the humble MAC address printed on the back of a router is six hex pairs separated by colons. If you work with text in other notations too, the Roman Numeral Copy Paste tool turns Roman numerals into plain numbers in the same spirit. All of these are the same skill: reading a compact code back into a form you can use, which is what the tool at the top of this page does. More converters of the same kind are listed in the Converters category.

What are the limits of this decoder?

This decoder reads a hex string as an unsigned whole number, as bytes, and as a 32-bit float. It does not read signed numbers, so FF on its own is 255, not -1; the signed reading depends on the width of the number and the system reading it, and a single hex string does not carry that information. It does not handle hex fractions, so a value such as 0x0.8 is refused; the point in the input is not a hex digit. It decodes text as single-byte ASCII, so multi-byte UTF-8 characters only appear correctly when all of their bytes are present and printable, and bytes above 127 are shown in brackets rather than as characters. It accepts at most 64 hex digits, which is 32 bytes, so a long hex dump needs to be split into pieces.

The float reading has its own limits. It reads the value as a single-precision 32-bit float, which holds about seven decimal digits of precision, so a value such as pi comes out as 3.1415927410125732 rather than the full pi. It does not read 64-bit doubles, which need sixteen hex digits and hold about fifteen decimal digits. If you need a double, a specialist programming tool is the right next step; the reading rules are the same, only the widths change.

Does anything I type leave my browser?

No. Every reading on this page is computed in your browser, on your own device. Nothing you type is uploaded to a server, nothing is stored, and there is no account to create. The hex values you decode might come from your own code, a log file, or a piece of homework, and none of that needs to leave your computer. Closing the page removes your inputs, and you can use the tool again any time, free, without signing up.

Frequently asked questions

What is hexadecimal decode?

Hexadecimal decode means reading a hex value back into the forms people use: its decimal number, its binary digits, its octal digits, the text its bytes spell out, and, for four bytes, the decimal number it stores as a 32-bit float. The tool at the top of this page does all five readings at once from one hex string, so you can paste a value from code or a log file and see every meaning of it in one place.

How do I convert hex to decimal by hand?

Number the digits from the right starting at 0, turn each digit into its value (A is 10, B is 11, C is 12, D is 13, E is 14, F is 15), multiply it by 16 to the power of its position, and add the results. For FF, the right-hand F is 15 times 1, which is 15, and the left-hand F is 15 times 16, which is 240, giving 255. For a longer value, such as 1A3, the working is 1 times 256, plus 10 times 16, plus 3 times 1, which is 256 plus 160 plus 3, giving 419.

What does 0xFF mean?

0xFF means the hex value FF, which is 255 in decimal. The 0x in front is a prefix used in code to say “what follows is hexadecimal”, and it carries no value of its own. FF is the largest value a single byte can hold, because each F is four bits set to 1, so two of them are eight bits set to 1, which is 255. It appears constantly in code, colour values and hardware settings for exactly that reason.

How do I decode hex to text?

Split the hex into pairs of two digits, turn each pair into its number, and look up the character with that number in the ASCII table. The hex string 48656C6C6F splits into 48, 65, 6C, 6C and 6F, which are 72, 101, 108, 108 and 111, and those are the characters H, e, l, l and o, so the string reads “Hello”. The value needs an even number of digits, because each character is one byte and one byte is two hex digits; a single leftover digit has no partner and the tool asks you to add a leading zero.

What is 0x3F800000 as a float?

0x3F800000 reads as the 32-bit float 1. Under the IEEE 754 standard, its bits split into sign 0, exponent 127 and mantissa 0. The exponent 127 means an exponent of zero once the fixed offset of 127 is subtracted, and a mantissa of zero means the number is exactly 1 times 2 to the power of 0, which is 1. The same four bytes as a plain number are 1,065,353,216 in decimal, which shows that the float reading and the number reading are two different ways of interpreting the same bits.

Why does my hex value need an even number of digits?

Because the tool reads hex two digits at a time, one byte per pair, and a single leftover digit has no partner. The text reading needs whole bytes, and the byte and bit counts need whole bytes too. The fix is to add a leading zero, which does not change the number: ABC becomes 0ABC, and 0ABC gives the same decimal value, with the bytes 0A and BC. Adding a zero at the end instead would change the value, so always add it at the front.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *