How to Convert a Character to Its Numeric ASCII Value in Excel
Question details
The user wants to find the specific Excel function that performs the reverse operation of the CHAR function, converting a given character into its corresponding numeric ASCII or Unicode value.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Converting characters to their underlying numeric codes for advanced data processing, cryptography, or text manipulation in spreadsheets.
- Observed behavior
- The user needs to input a character string (such as "A") and successfully output its numeric integer code (such as 65).
Determine whether you are working with standard ASCII text or extended Unicode characters, as this will dictate the specific formula you need to apply.
Use the CODE Function for Standard ASCII Characters
The CODE function is the direct reverse of the CHAR function. It returns the numeric code for the first character in a standard text string.
The CODE function evaluates the computer's default character set (typically ASCII or ANSI) to return an integer corresponding to the specified text.
It is perfect for standard alphabet letters, numbers, and basic punctuation marks.
Click on the empty cell where you want the numeric ASCII value to be displayed.
Type `=CODE("A")` into the formula bar to get the code for the letter A, or reference a cell by typing `=CODE(A1)`.
Press the Enter key. The cell will now display the numeric code, such as 65 for a capital A.

Use the UNICODE Function for Special Symbols
For characters outside the standard ASCII range, such as emojis or international symbols, use the UNICODE function to retrieve the correct code point.
Easily Convert Characters to ASCII with WPS Spreadsheet
WPS Spreadsheet fully supports advanced text functions like CODE and UNICODE, allowing you to manipulate and analyze text data effortlessly. Enjoy a highly efficient, familiar interface that flawlessly handles all your data conversion needs.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing the characters you wish to convert.
- 2. Select the output cell: Click on the blank cell where you want the resulting numeric value to be shown.
- 3. Apply the formula: Type `=CODE(A1)` (replacing A1 with your target cell) and press Enter to instantly see the ASCII value.

Frequently Asked Questions
What is the difference between the CODE and UNICODE functions?
The CODE function returns the numeric code based on your computer's local character set (usually ASCII or ANSI). The UNICODE function returns the standard ISO Unicode code point, which supports a much wider array of global characters, special symbols, and emojis.
How do I convert a numeric ASCII value back to a character?
You can use the CHAR function. For example, entering `=CHAR(65)` in a cell will return the character 'A'. For standard Unicode numbers, use the UNICHAR function instead.
Why does the formula `=CODE("ABC")` only return 65?
The CODE function is designed to evaluate only the very first character of a given text string. To get the codes for subsequent characters like 'B' or 'C', you must first extract them using text functions like MID before passing them to the CODE function.




