Category: FUNCTION | Updated: 2026-11-22

How to Use the UNICODE Function in Google Sheets | Look Up the Unicode Number of a Character

How to Use the UNICODE Function in Google Sheets

The UNICODE function returns the decimal Unicode value of the first character in a text string. It performs the reverse of UNICHAR and is very useful for data cleansing, such as detecting full-width vs. half-width characters or identifying invisible special spaces.

Syntax

=UNICODE(text)
  • text: The text string or cell containing the text whose Unicode value you want to find.

Examples

Here is an example of retrieving Unicode values in Column B for characters entered in Column A.

Row A (Text) B (Formula) Result Description
1 A =UNICODE(A1) 65 Code for half-width letter “A”
2 A =UNICODE(A2) 65313 Code for full-width letter “A”
3 あいうえお =UNICODE(A3) 12354 Returns the code for the first character “あ” only
4   =UNICODE(A4) 12288 Code for a full-width space (half-width space is 32)

Note: When typing a character directly into the formula, enclose it in double quotation marks, such as =UNICODE("あ").

Common Errors and Tips

  • When #VALUE! errors occur
    • Passing an empty string ("") or a blank cell returns #VALUE!. If your range may contain blank cells, wrap the formula with IFERROR, such as =IFERROR(UNICODE(A1), "").
  • Characters after the first are ignored
    • Passing a multi-character string like "Google" does not cause an error; it simply returns the code for "G" (71).
  • Great for distinguishing look-alike characters
    • Characters that look almost identical—such as the kanji “一” (19968) vs. the katakana prolonged sound mark “ー” (12540), or a standard space (32) vs. a non-breaking space (160)—can be clearly differentiated by their numeric codes.

Frequently Asked Questions

Q. If a cell contains multiple characters, which character's code is returned?

A. Only the Unicode value of the "first character" in the string is returned. To check subsequent characters, extract them one by one using MID first.

Q. Does UNICODE distinguish between visually similar full-width and half-width characters?

A. Yes. For example, half-width "A" returns 65 while full-width "A" returns 65313, making it useful for spotting formatting inconsistencies in data.