← All comparisons

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

CHARCODEUNICHARUNICODE
Range1-255 (ANSI/ASCII)First char → its 1-255 codeAny Unicode code point (→ "✓", "€", emoji)First char → full code point
Star useCHAR(10) = line break inside a cellDetecting invisible characters in importsSymbols without hunting menus: UNICHAR(10003)=✓Auditing exactly which character an import contains
Beyond 255Errors or wrong glyphReturns ? -codes for non-ANSIWorksWorks
CompatibilityUniversalUniversalExcel 2013+ / Sheets / LibreOfficeSame as UNICHAR

Which should you use?

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.