Author: Oscar Cronquist Article last updated on March 29, 2018

The CODE function returns a specific number for the first character of the text argument, determined by your computers character set.

Windows ANSI
Macintosh Macintosh character set

Excel Function Syntax



text Required. The character for which you want the corresponding code.


A to Z correspond to numbers 65 to 90.

a to z correspond to numbers 97 to 122.