The Excel UNICODE function returns the Unicode code point of the first character of a text string — the number that tells you what a character really is. That makes it the forensic tool for imported data: the “space” that breaks your lookups turns out to be character 160, the “dash” is an en dash 8211, the “quote” is a curly 8220. It is the modern, full-Unicode replacement for CODE and the mirror image of UNICHAR. Available in Excel 2013 and later.
=UNICODE("A") returns 65; =UNICODE("™") returns 8482. Only the first character is examined — use MID to inspect others.
Syntax
| Argument | Description | |
|---|---|---|
text | Required | The text whose first character you want the code point of. Empty text "" returns #VALUE!. |
Available in: Excel 2013 and later, Excel for Microsoft 365, and Excel for the web. Older versions show #NAME? — the legacy CODE function exists everywhere but only answers correctly for characters 1–255.
Identify any character
Point UNICODE at a character and it names the number. The boring rows are sanity checks; the interesting rows are the troublemakers that look like something else:
| A | B | |
|---|---|---|
| 1 | Character | =UNICODE(A2) |
| 2 | A | 65 |
| 3 | ™ | 8482 |
| 4 | • | 8226 |
| 5 | (non-breaking space) | 160 |
| 6 | – (en dash) | 8211 |
To inspect a character in the middle of a string, slice it out with MID first:
Try it: interactive UNICODE demo
Type or paste any character — UNICODE reports the code point of the first one. Paste a mystery character from your own data to unmask it.
Debug the invisible: why your lookups fail
Two cells look identical, yet =A2=B2 says FALSE and VLOOKUP finds nothing. UNICODE settles the argument. Walk the string character by character — in Excel 365 one spilling formula maps every code point:
The usual suspects this exposes:
| Looks like | Actually is | Code |
|---|---|---|
| a space | non-breaking space (web imports) | 160 |
| a space | zero-width space | 8203 |
| a hyphen - | en dash or em dash | 8211 / 8212 |
| a quote " | curly quotes from Word | 8220 / 8221 |
| the letter A | Cyrillic A | 1040 |
Once identified, swap the offender out with SUBSTITUTE + UNICHAR:
Errors & common pitfalls
#VALUE! — empty text. =UNICODE("") has no first character to report. Guard with =IF(A2="", "", UNICODE(A2)) when the column has blanks.
#NAME? — Excel 2010 or earlier. UNICODE arrived in Excel 2013. The legacy CODE works there, but reports a misleading answer (often 63, a question mark) for anything outside its 255-character range.
Pitfall: only the first character counts. =UNICODE("Dallas") returns 68 — the D — and says nothing about the rest. Use MID (or the SEQUENCE recipe above) to scan a whole string.
Pitfall: numbers get converted to text first. Point UNICODE at the number 742 and it sees the string “742”, returning 55 for the digit 7 — not an error, just probably not what you meant.
Practice workbook
Frequently asked questions
What's the difference between UNICODE and CODE?
How do I find an invisible character that's breaking my VLOOKUP?
=LEN(A2) vs what you see. Then scan: =UNICODE(MID(A2,SEQUENCE(LEN(A2)),1)) spills every code point. A 160 means non-breaking space — remove it with =SUBSTITUTE(A2,UNICHAR(160)," ") and TRIM.Does UNICODE look at the whole string or just one character?
Are UNICODE and UNICHAR opposites?
=UNICHAR(UNICODE(A2)) returns A2’s first character unchanged. UNICODE goes character → number; UNICHAR goes number → character.Why do UNICODE and CODE give different answers for the same character?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class