Function Problems

How to Convert a Character to Its Numeric ASCII Value in Excel

John WilsonJohn Wilson Nov 2, 2026 870 views

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.

How to Convert a Character to Its Numeric ASCII Value in Excel
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).
Before you start

Determine whether you are working with standard ASCII text or extended Unicode characters, as this will dictate the specific formula you need to apply.

Solution 1Recommended

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.

1
Select the target cell

Click on the empty cell where you want the numeric ASCII value to be displayed.

2
Enter the CODE formula

Type `=CODE("A")` into the formula bar to get the code for the letter A, or reference a cell by typing `=CODE(A1)`.

3
Apply the formula

Press the Enter key. The cell will now display the numeric code, such as 65 for a capital A.

Use the CODE Function for Standard ASCII Characters
Evaluates First Character Only: If you supply a multi-character string like "Apple", the CODE function will only return the numeric value for the first character, which is "A".
Efficient Text Processing

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. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing the characters you wish to convert.
  2. 2. Select the output cell: Click on the blank cell where you want the resulting numeric value to be shown.
  3. 3. Apply the formula: Type `=CODE(A1)` (replacing A1 with your target cell) and press Enter to instantly see the ASCII value.
100% compatible with Microsoft Excel formulas, including CODE, UNICODE, CHAR, and UNICHARLightweight application that opens quickly and runs smoothly on PC and mobileFree to download and use for all standard data processing tasks
microsoft office alternative - wps office

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.