Skip to content

CHAR

Returns the character for a number code from 1 to 255, such as a line break, a quotation mark or a letter.

Syntax

=CHAR()

Text

All versions of Excel.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
1
Name
Team
Badge
2
Dana Whitfield
Finance
Dana Whitfield Finance
3
4

C2 =A2&CHAR(10)&B2 returns Dana Whitfield Finance

How CHAR works

CHAR returns the character that matches a number code. In practice it is used for two things: typing characters that are awkward to put in a formula, such as a line break or a double quotation mark, and building letters from numbers.

The most useful codes

Codes 1 to 127 are the same on Windows and Mac:

| Code | Character | |---|---| | 9 | Tab | | 10 | Line break (line feed) | | 13 | Carriage return | | 32 | Space | | 34 | Double quotation mark | | 65 to 90 | A to Z | | 97 to 122 | a to z | | 48 to 57 | 0 to 9 |

Line breaks in a cell

=A2&CHAR(10)&B2 joins two cells with a line break between them. The break only shows once the cell has Wrap Text turned on. Without it, you see both values on one line. TEXTJOIN with CHAR(10) as the delimiter builds a multi-line list. To take line breaks out of imported text, replace them: =SUBSTITUTE(A2,CHAR(10)," ").

Quotation marks

A double quotation mark is awkward to type inside a formula's text, because quotes end the text. CHAR(34) supplies one: =CHAR(34)&A2&CHAR(34) wraps the value of A2 in quotes. You can also double the quotes inside the string: =""""&A2&"""" returns the same result, but is hard to read.

Letters from numbers

Letters run in order from 65. =CHAR(64+3) returns C, the third letter. That is how to turn a column number into a column letter for up to 26 columns, or number a list A, B, C.

Stay below 128

Codes 128 to 255 depend on the character set of the computer. Windows and Mac assign them to different symbols, so a workbook that uses CHAR(169) can show a different symbol, or none, on another machine. When you need a symbol outside the basic set, use UNICHAR, which uses Unicode and gives the same character everywhere.

What CHAR does not do

CHAR accepts one number and returns one character. It doesn't accept 0 or numbers over 255, which return #VALUE!. It also can't build multi-character text on its own. It is the reverse of CODE, which returns the number for a character: =CODE(CHAR(65)) returns 65.

Arrays

In Microsoft 365 you can pass CHAR an array of numbers, which makes a sequence of characters. =CHAR(SEQUENCE(5,1,65)) returns A to E down a column.

Arguments

number
A whole number from 1 to 255 that identifies a character. 10 is a line break, 34 is a double quotation mark, 65 is "A". Other values return #VALUE!.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Join two cells with a line break

C2 =A2&CHAR(10)&B2

Result: Dana Whitfield Finance

CHAR(10) is a line break. Turn on Wrap Text for C2 to see the two lines.

C2
A
B
C
1
Name
Team
Badge
2
Dana Whitfield
Finance
Dana Whitfield Finance
3
4

C2 =A2&CHAR(10)&B2 returns Dana Whitfield Finance

Example 2

Wrap text in quotation marks

C2 =CHAR(34)&A2&CHAR(34)

Result: "Nitrile gloves"

CHAR(34) is the double quotation mark. It saves you from escaping quotes inside the formula.

C2
A
B
C
1
Product
Qty
Quoted
2
Nitrile gloves
120
"Nitrile gloves"
3
4

C2 =CHAR(34)&A2&CHAR(34) returns "Nitrile gloves"

Example 3

Turn a number into a letter

C2 =CHAR(64+A2)

Result: C

Letter A is code 65, so 64 plus the position gives the matching letter. A position of 3 returns C.

C2
A
B
C
1
Position
Section
Letter
2
3
Receiving
C
3
4

C2 =CHAR(64+A2) returns C

Example 4

Build a sentence with a quotation

C2 =B2&": "&CHAR(34)&A2&CHAR(34)

Result: Survey: "Faster than before"

The comment is placed inside quotation marks without any escaping in the formula.

C2
A
B
C
1
Feedback
Source
Report line
2
Faster than before
Survey
Survey: "Faster than before"
3
4

C2 =B2&": "&CHAR(34)&A2&CHAR(34) returns Survey: "Faster than before"

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, turn the position in A2 into a letter, so 1 gives A and 2 gives B. Fill it down to B5.

Answer in B2, then it fills down to B5.

B2
A
B
C
D
1
Position
Letter
Item
Quoted
2
1
Nitrile gloves
3
2
Floor cleaner
4
3
Pallet wrap
5
4
Safety boots
6
7

Common mistakes

  • CHAR(10) shows as a line break only when Wrap Text is on. Without it, the text runs together on one line.
  • Codes 128 to 255 differ between Windows and Mac. A formula that uses them can show different characters on another computer. Use UNICHAR for symbols.
  • CHAR only accepts whole numbers from 1 to 255. CHAR(0) and CHAR(256) both return #VALUE!.
  • CHAR(13), a carriage return, is not the usual line break in Excel. Use CHAR(10).
  • CHAR returns text. A digit such as CHAR(53) is the text "5", not the number 5.

Questions people ask

How do I add a line break in an Excel formula?

Use `CHAR(10)`: `=A2&CHAR(10)&B2`. Turn on Wrap Text in the cell, or the break won't show.

How do I put quotation marks inside a formula?

Use `CHAR(34)`, as in `=CHAR(34)&A2&CHAR(34)`. You can also double the quotes inside the text: `=""""&A2&""""`.

How do I turn a number into a letter?

Add the number to 64 and pass it to CHAR: `=CHAR(64+A2)` returns A for 1, B for 2 and so on up to Z for 26. For lower case, use 96 instead of 64.

What is the difference between CHAR and UNICHAR?

CHAR uses the 1 to 255 character set of your computer. UNICHAR uses Unicode, so it covers symbols and other alphabets and returns the same character on any computer.

What is the opposite of CHAR?

CODE. `=CODE("A")` returns 65 and `=CHAR(65)` returns "A".

Learn CHAR in a real sheet.

CHAR is taught in Logic and text, lesson 9: SUBSTITUTE. Each lesson is a short, graded exercise like the one above.