Text function

CHAR function

Returns the character that belongs to a code number from 1 to 255, such as CHAR(10) for a line break inside a cell.

Available in All versions of Excel, including Microsoft 365, Excel for Mac and Excel for the web

In every Excel versionDifferent in Google Sheets

Syntax

CHAR(number)
ArgumentWhat it means
numberRequiredA whole number from 1 to 255. Decimals are truncated.

Returns: A single character as text.

How CHAR works

Every character Excel can store has a code number. CHAR goes from the number to the character: =CHAR(65) is A, =CHAR(97) is a, =CHAR(36) is $. On Windows the codes follow the Windows-1252 (ANSI) character set, on older Mac versions the Mac Roman set, so codes above 127 can give different symbols on different machines.

The most common real use is CHAR(10), the line feed, which starts a new line inside a cell. Join pieces of an address or a label with &CHAR(10)& and switch on Wrap Text for the cell, otherwise the break is invisible. Other handy codes are CHAR(34) for a double quote, CHAR(9) for a tab and CHAR(160) for a non-breaking space.

CHAR only covers codes 1-255. For any other symbol (arrows, stars, emoji, Greek or Cyrillic letters) use UNICHAR, which accepts full Unicode code points. The reverse of CHAR is CODE.

Examples

1Turn a column number into a column letter

B2fx=CHAR(64+A2)
AB
1Column no.Letter
23C
312

Result: C

The capital letters start at code 65 (A), so 64 + 3 = 67, which is C. This trick works for columns 1-26.

2Address on two lines in one cell

C2fx=A2&CHAR(10)&B2
ABC
1CustomerCity
2Ana SilvaLisbonAna Silva
Lisbon

Result: Ana Silva
Lisbon

CHAR(10) inserts a line feed between the name and the city. With Wrap Text switched on for C2 the cell shows Ana Silva on the first line and Lisbon on the second.

3Put quotation marks around a value

B2fx=CHAR(34)&A2&CHAR(34)
AB
1Product
2Desk Lamp"Desk Lamp"

Result: "Desk Lamp"

CHAR(34) is the double-quote character, which is easier to read than writing """" inside a formula.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!The number is below 1 or above 255, or is text.Use a value from 1 to 255; for higher Unicode code points use UNICHAR.

Tips

  • A line break made with CHAR(10) needs Wrap Text on the cell to be visible; on a Mac in very old versions the line break was CHAR(13).
  • To remove line breaks again use =SUBSTITUTE(A2,CHAR(10)," ") or CLEAN.
  • CHAR(128) is the euro sign on Windows but not on every platform. Use UNICHAR(8364) when the workbook travels between systems.

Google Sheets

Google Sheets uses Unicode for every code, so CHAR for codes 128–255 can return different characters than Excel for Windows, which uses the ANSI code page.

CHAR in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechZNAK
DanishTEGN
DutchTEKEN
FinnishMERKKI
FrenchCAR
GermanZEICHEN
HungarianKARAKTER
ItalianCODICE.CARATT
Norwegian (Bokmål)TEGNKODE
PolishZNAK
Portuguese (Brazil)CARACT
Portuguese (Portugal)CARÁT
RussianСИМВОЛ
SpanishCARACTER
SwedishTECKENKOD
TurkishDAMGA

Recipes that use CHAR