# Convert Hexadecimal Values to ASCII in Excel

Excel does not recognize hexadecimal values as numeric values. It has a function to convert hex values to decimal values but not one to convert them to ASCII values. To use special characters in Excel Cells, we will need the help of ASCII codes. They provide more meaning to the information and also make data easier to understand.

## Hexadecimal numbering system

The hexadecimal numbering system utilizes the Base 16 system, meaning it has 16 possible digit symbols.

It uses 16 symbols which are {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F} to represent all numbers. The {A, B, C, D, E, F} stands for {10, 11, 12, 13, 14, 15}.

## ASCII

ASCII is the acronym for American Standard Code for Information Interchange. It is a standard that allocates numbers, letters, and other characters within the range of the 256 spaces available in the 8-bit code. It ranges from 00 to FF in Hexadecimal. For example, the Hexadecimal value of “30” is the value “0” in ASCII.

Given a hexadecimal value, many people resort to going to the web to look up ASCII character code charts.

It would be more convenient if this could be done automatically in Excel.

## 2 Methods of converting hexadecimal values to ASCII in Excel

In this tutorial we will look at the following 2 methods of converting Hex values to ASCII:

1. Use HEX2DEC and CHAR functions
2. Use Excel VBA Code

### Method 1- Use HEX2DEC and CHAR functions

This method works by first converting the hexadecimal value to a decimal value and then finally converting the decimal value to an ASCII value.

We will use the following dataset to show how this can be done:

Step 1 – Select Cell B3 and key in the formula =HEX2DEC(A3) as follows:

Step 2 – Press the Enter key and use the Fill Handle to copy the formula down:

Step 3 – Select Cell C3 and enter the formula =CHAR(B3) as follows:

Step 4 – Press Enter key and drag down the Fill Handle to copy the formula to other cells as follows:

The CHAR function returns the character specified by the code number from the character set of your computer. It can be seen that the hexadecimal value “30” has been converted to the ASCII value of “0”, and so on.

### Method 2 – Use Excel VBA Code

This method will require that one has a working knowledge of Excel VBA.

We will use the following dataset to demonstrate how this method works:

We will use a User Defined Function to convert hexadecimal values into ASCII values by doing the following steps:

Step 1 – Press Alt + F11 to open the Visual Basic Editor:

Step 2 – In the Project Window right click your worksheet and insert a new module.

Step 3 – In the new module, enter the following code:

``````Public Function HEX2ASCII(ByVal hextext As String) As String
Dim y As Integer
Dim num As Integer
Dim Value As Integer
For y = 1 To Len(hextext)
num = Mid(hextext, y, 2)
Value = Value & Chr(Val("&h" & num))
y = y + 1
Next y
HEX2ASCII = Value
End Function
``````

Step 4 – Save the workbook and switch back to the active worksheet by pressing Alt + F11

Step 5 – Select Cell B3 in the dataset and enter the formula =Hex2ASCII(A3) as follows:

Step 6 – Press the Enter key and drag down the Fill Handle:

The hexadecimal values are converted to ASCII values. You can use this User Defined Function to convert any hexadecimal value to an ASCII value.
{"ft_lang_label":"__label__en","ft_lang_prob":0.74278057,"math_prob":0.9076185,"size":3263,"snap":"2022-40-2023-06","text_gpt3_token_len":797,"char_repetition_ratio":0.15372814,"word_repetition_ratio":0.049833886,"special_character_ratio":0.24701196,"punctuation_ratio":0.10166919,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9917213,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-10-06T23:13:06Z\",\"WARC-Record-ID\":\"<urn:uuid:86dee95a-0921-42fa-ad58-aae9e6904c64>\",\"Content-Length\":\"63290\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:fbb6b6ea-c072-4f46-8e23-b31440e7b43c>\",\"WARC-Concurrent-To\":\"<urn:uuid:d1ca81b2-1958-49b8-8c0e-aeb9c59d7a59>\",\"WARC-IP-Address\":\"104.21.5.132\",\"WARC-Target-URI\":\"https://excel.officetuts.net/examples/convert-hexadecimal-values-to-ascii/\",\"WARC-Payload-Digest\":\"sha1:FRRPON677Y3J7OSBMD6H45LIT4CIODZV\",\"WARC-Block-Digest\":\"sha1:K25YJA7XSW7376RJLOWI3QKOBQWBHN7T\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030337889.44_warc_CC-MAIN-20221006222634-20221007012634-00362.warc.gz\"}"}