Excel function

CHARfunction

Returns the character for a character code (1–255).

All versions
=CHAR(A2)
A
B
1
2
3
4
5
6
7
8

Click a cell in the table to change number. Click 10. It is the invisible line break character, used to break lines inside a cell with a formula. Try breaking it on purpose to see the errors.

Result

A

number
A2You can also click a cell in the table

The cell containing a character code. Click other values in the sheet.

What is the CHAR function?

=CHAR(number)

CHAR turns a character code from 1 to 255 into a character. Its most common use is CHAR(10), a line break inside a cell.

According to Microsoft, the result follows your computer's character set (ANSI on Windows, the Mac character set on Mac). Codes 32–126, with letters, digits and symbols, are the same everywhere, but 128 and above can vary, so they are left out of the example above.

Arguments

number
A character code from 1 to 255. Outside that range gives #VALUE!.

CHAR examples

  1. Example 1. Example from Microsoft

    =CHAR(65)

    A. CHAR(33) is !.

  2. Example 2. Line break in a cell

    =A2 & CHAR(10) & B2

    Puts a line break between two values. Turn on Wrap Text for the cell to see two lines.

  3. Example 3. Make A to Z

    =CHAR(64+ROW())

    Enter it in row 1 and fill down to get A, B, C...

Common mistakes

FAQ

What is the opposite function?
CODE. CODE("A") is 65.
Remove line breaks?
Replace them with spaces, like =SUBSTITUTE(A2, CHAR(10), " "), or use CLEAN.