Hex to Text: Encode and Convert Online
Hexadecimal notation is just a way of describing integers in a different base other than the usual decimal base that we’re familiar with.
Hexadecimal notation uses base 16 which means that as opposed to the standard 10 digits that we are used to; we’re going to use a system in which there are 16 digits.
Those digits are represented by the number 0 through 9 along with the six letters A through F as indicated in the table below.
Hexadecimal (base16) conversion table
Decimal Number 
4bit Binary Number 
Hexadecimal Number 
0 
0000 
0 
1 
0001 
1 
2 
0010 
2 
3 
0011 
3 
4 
0100 
4 
5 
0101 
5 
6 
0110 
6 
7 
0111 
7 
8 
1000 
8 
9 
1001 
9 
10 
1010 
A 
11 
1011 
B 
12 
1100 
C 
13 
1101 
D 
14 
1110 
E 
15 
1111 
F 
Each of those hexadecimal digits corresponds to a different value in the range of 0 to 15.
So, the hex digits 0 through 9 corresponds to the values 0 through 9 and then the hex digit A corresponds to 10, the hex digit B corresponds to 11 and so on up through the hex digit F which corresponds to the value 15.
Hex digits are also very convenient because there’s a one to one correspondence between each hex digit and sequence of 4 bits which are sometimes also called a nibble.
4 bits is exactly half a byte which is 8 bits and so a sequence of 4 bits is sometimes also referred to as a nibble.
As you can see from the table above, the hex digit 0 corresponds to the nibble 0000 and so on up through the hex digit F which corresponds to the nibble 1111.
These correspondences aren’t arbitrary. What you’ll see is that each hex digit corresponding to a particular nibble corresponds to the value of that nibble if you view it as a binary integer.
Just as an example, if we look at the hex digit F that corresponds to the nibble 1111 and in binary notation the value 1111 corresponds to:
1111 = 2^3 + 2^2 + 2^1 + 2^0 = 15
Which in fact is the value that corresponds to the hex digit F.
How to convert hexadecimal to decimal notation
For example, lets convert hex ABC to a decimal:
C = 12 * (16 ^ 0) 12
B = 11 * (16 ^ 1) 176
A = 10 * (16 ^ 2) 2560
Then, we add the results:
2560 + 176 + 12 = 274810 decimal
We can also represent the hex ABC in terms of binary representation. And it’s very easy to do that because each hex digit corresponds to a nibble.
Hex ABC = [1010 1011 1100].
And again that 12bit binary corresponds to the value 2748 if we view that 12bit number as a binary number.
ASCII Representation
Ultimately everything in a computer is represented as bits and ASCII representation is very often used to represent English letter characters.
In ASCII representation each character is represented using one byte or 8 bits or equivalently two hex digits.
Here is a table indicating the correspondences between characters in the English alphabet along with other characters as well as their corresponding ASCII equivalent.









You can see that alongside every character the table includes both their ASCII representation written in hex as well as in decimal.
You can check that all the numbers line up by performing a calculation just like we did earlier.
For example;
“1” = 0x31 = 0011 0001
“F” = 0x46 = 0100 0110
If we look at the character “1” which is the numeral one, that has value hex 31 in the ASCII representation.
That means that if you have a file and somewhere in that file you have the character “1”, that would actually be recorded in your computer as the hex value 31.
At the lower level it would be represented as a sequence of bits (00110001).
That is to say the nibble corresponding to 3 and the nibble corresponding to 1.
The key thing I want to point out here is that the character 1 is not the same thing as the number 1.
The character 1 is just a character and it’s arbitrary been assigned the ASCII value of hex 31 in ASCII representation.
And if you have a character 1 in a file it’s not stored as a single bit 1, it’s stored as the byte (00110001).
And similarly, for the rest of the characters are stored in the same way.
Data representation
The question is, how do we store the value hex 1F to a file. There are two ways we could go about doing this.
The first possibility is what I call native hex.
And in this case, we store the value exactly as the sequence of bits that it represents. For example, we could store the value hex 1F to a file as (0001 1111).
The problem with that is that if we then try to view that file using a standard text editor, we’ll get a none printable character.
And if you go back and look at the ASCII table, you’ll see that the hex 1F corresponds to some unprintable character not a regular character in the alphabet or a numeral or punctuation.
That’s okay if all you’re doing is reading from that file from a program but it’s inconvenient if we’re trying to look at the file or manipulate the file by hand.
The second possibility is to store the hex value 1F as the ASCII characters 1F.
If we do that then recall that every ASCII character is represented using one byte so, what we now have is something stored using 2 bytes rather than one.
That is using 16 bits rather than 8 bits.
If we store the ASCII characters 1F to a file then what we’ll end up actually storing in terms of bits is (0011 0001 0100 0110).
Which you obtain by looking up the character 1 and F in the ASCII table and writing out their corresponding representations.
Now if we view this file using a text editor or from the command line, we see what we expect.
We see the characters 1F.
If we read it from a program, the program is going to see a sequence of 16 bits.
We just need to be careful and tell the program to convert that sequence of 16 bits into the hex value 1F.
How to convert hex to text
For example, convert hex (6b 69 66 61 6e 67 61) to text.
Step 1. Group the hex values string into groups of two characters.
Group = [6b 69 66 61 6e 67 61].
Step 2. Read the corresponding ASCII character with each hex pair.
ASCII characters = [k, I, f, a, n, g, a].
Thus, hex (6b 69 66 61 6e 67 61) to text is (kifanga).
Use the above hex to text converter to easily translate your hexadecimal values to their ASCII equivalents.