CHAR vs CODE vs UNICHAR: characters by number
CHAR turns a number into a character and CODE goes the other way — but they speak 8-bit: numbers up to 255. UNICHAR/UNICODE are the same pair with the full Unicode range, which is what you want for symbols, arrows, and emoji.
The differences at a glance
| CHAR | CODE | UNICHAR | UNICODE | |
|---|---|---|---|---|
| Range | 1-255 (ANSI/ASCII) | First char → its 1-255 code | Any Unicode code point (→ "✓", "€", emoji) | First char → full code point |
| Star use | CHAR(10) = line break inside a cell | Detecting invisible characters in imports | Symbols without hunting menus: UNICHAR(10003)=✓ | Auditing exactly which character an import contains |
| Beyond 255 | Errors or wrong glyph | Returns ? -codes for non-ANSI | Works | Works |
| Compatibility | Universal | Universal | Excel 2013+ / Sheets / LibreOffice | Same as UNICHAR |
Which should you use?
- CHAR / CODE — The classics: CHAR(10) for in-cell line breaks (pair with TEXTJOIN or wrap-text), CHAR(34) for literal quotes, CODE to expose why two 'identical' cells differ (nonbreaking space = 160 vs space = 32).
- UNICHAR / UNICODE — Anything outside Latin-1: checkmarks, arrows, box-drawing, currency signs, emoji — and UNICODE when diagnosing imported text with characters CODE can't represent.
Compatibility (from executed tests)
CHAR and CODE execute identically in every version of all three apps we test; UNICHAR/UNICODE are documented across all three modern apps (Excel 2013+). One cross-app footnote: what CHAR(128)-CHAR(255) draw depends on the system code page in very old Excel — another reason to prefer UNICHAR for anything non-ASCII.
Example formulas
| Line break in a formula-built cell | =A2&CHAR(10)&B2 |
| Expose an invisible character | =CODE(MID(A2,5,1)) |
| Checkmark by code point | =UNICHAR(10003) |
Full per-version details on each function page: CHAR · CODE · UNICHAR · UNICODE.