CHAR Function in Excel

Sumit Bansal
Written by

Sumit Bansal is the founder of TrumpExcel.com and a 13-time Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

The CHAR function in Excel takes a code number and returns the character that goes with it. For example, 65 gives you the letter A, and 169 gives you the © symbol.

It’s handy when you need a character you can’t easily type into a formula, such as a line break, a double quote, or a symbol like ° or €.

In this article, I’ll show you how to use the CHAR function with six practical examples, including symbols, line breaks, and cleaning up text copied from a website.

Follow along with the example file

CHAR Function Examples.xlsx

Download

CHAR Function Syntax

Here is the syntax of the CHAR function:

=CHAR(number)
  • number – Required. The code of the character you want, from 1 to 255. It can be a number, a cell reference, or a formula that returns a number.

If number is 0, negative, or bigger than 255, CHAR returns the #VALUE! error. The same happens when number points to an empty cell, because Excel reads the empty cell as 0.

If number has decimals, Excel drops the decimal part, so =CHAR(65.7) still returns A.

The characters come from your computer’s character set, which is different on Windows and Mac. So some codes, mostly between 128 and 255, can return a different character on a Mac.

The CHAR function works in all Excel versions, including 365, 2024, 2021, 2019, 2016, Mac, and the web. Excel for the web only supports codes 9, 10, 13, and 32 to 255.

When to Use the CHAR Function

Use this function when you need to:

  • Insert symbols like ©, °, €, or • without hunting for them in the Symbol dialog box
  • Add a line break inside a cell with a formula
  • Put a double quote (or an inch mark) in a formula result
  • Create a list of letters from A to Z
  • Remove hidden characters, such as line breaks or non-breaking spaces, from text you imported or copied

Let me show you six examples of how this works.

Example 1: Insert Special Symbols Using CHAR Codes

Let’s start with the simplest use, turning code numbers into symbols.

Below I have a list of symbols with their CHAR codes in column B, and I want to get the actual symbol for each code in column C.

List of symbol names with their CHAR codes and an empty Character column

Here is the formula:

=CHAR(B2:B11)
CHAR formula turning each code into its symbol, such as 169 into the copyright sign

CHAR reads each code in B2:B11 and returns the matching character, so 169 becomes ©, 176 becomes °, and 149 becomes a bullet (•).

Since I gave CHAR a whole range, the results spill into C2:C11 on their own. If any cell in that range already has something in it, you’ll get a #SPILL! error until you clear it.

If you are using Excel 2019 or earlier, enter the below formula in cell C2 and then copy it down the range:

=CHAR(B2)

The same goes for the spilling formulas in Examples 2, 3, 5, and 6 (Example 4 has its own older-version formula). In older versions, point the formula at the first cell of each range (B2 instead of B2:B11) and copy it down.

CHAR only goes up to 255, so symbols like the check mark (✓) or the arrow (→) aren’t on this list. For those, use the UNICHAR function, which accepts much larger codes.

Pro Tip: If you’re not sure what code a character has, use the CODE function. It does the reverse of CHAR and returns the code number of any character you give it.

Example 2: Add Inch Marks (Double Quotes) With CHAR(34)

Now let’s use CHAR to put a double quote in a formula result.

Below I have a list of products with their width and height in inches, and I want to create a size label like 8″ x 10″ in column D.

Products with width and height in inches and an empty Size column

Here is the formula:

=B2:B11&CHAR(34)&" x "&C2:C11&CHAR(34)
Formula using CHAR(34) to create size labels with inch marks, such as 8" x 10"

CHAR(34) returns the double quote character (“), which here works as the inch mark. The & operator joins the width, an inch mark, the ” x ” text, the height, and another inch mark.

You could also type the double quote straight into the formula, but Excel needs it written as four quotes in a row (“”””) for that to work. That’s hard to read and easy to get wrong, so CHAR(34) is much cleaner.

Example 3: Add a Line Break in a Cell With CHAR(10)

Now let’s use CHAR to add a line break inside a cell.

Below I have a class schedule with the class, teacher, and room, and I want to combine all three into one cell, each on its own line, in column D.

Class schedule with class, teacher, and room columns and an empty Schedule Label column

Here is the formula:

=A2:A11&CHAR(10)&B2:B11&CHAR(10)&C2:C11
Formula using CHAR(10) to put the class, teacher, and room on separate lines in one cell

CHAR(10) is the line break character in Excel, the same one you get when you press Alt + Enter while typing in a cell. Putting it between the class, teacher, and room pushes each one onto a new line.

Important: The line breaks only show up when Wrap Text is turned on for the result cells (Home tab, Alignment group). Without it, you’ll see all three values run together on one line.

If you want to add line breaks by hand instead of with a formula, here is how to start a new line in an Excel cell.

Example 4: Create a List of Letters A to Z

Here’s a fun one that uses CHAR with the SEQUENCE function.

I want a list of the capital letters A to Z in column A, starting in cell A1.

The capital letters have the codes 65 to 90, so all CHAR needs is those 26 numbers.

Here is the formula:

=CHAR(SEQUENCE(26,1,65))
CHAR and SEQUENCE formula in cell A1 spilling the letters A to Z down column A

SEQUENCE(26,1,65) creates 26 numbers in one column, starting at 65. CHAR turns each of them into a letter, so the result spills from A1 down to A26.

If you need lowercase letters, change the 65 to 97, which is the code for a lowercase a.

The SEQUENCE function is only available in Excel 365 and Excel 2021 or later. If you are using Excel 2019 or earlier, enter the below formula in cell A1 and then copy it down to cell A26:

=CHAR(ROW(A1)+64)

Example 5: Replace Line Breaks With Commas

Now let’s go the other way and get rid of line breaks.

Below I have a list of grocery orders where each item sits on its own line inside the cell, and I want the items as one comma-separated line in column C.

Grocery orders with each item on its own line in the cell and an empty Items (One Line) column

Here is the formula:

=SUBSTITUTE(B2:B9,CHAR(10),", ")
SUBSTITUTE and CHAR(10) formula replacing the line breaks in each order with commas

The SUBSTITUTE function looks for every CHAR(10) line break in B2:B9 and replaces it with a comma and a space. So “Milk”, “Bread”, and “Eggs” on three lines become Milk, Bread, Eggs.

For more ways to do this, see how to remove line breaks in Excel.

Example 6: Remove Non-Breaking Spaces Copied From a Website

Let’s finish with a cleanup problem that often shows up when you copy data from a web page.

Below I have product prices I copied from a website, and Excel treats them as text, so they can’t be added up. I want them as real numbers in column C.

Product prices copied from a website, stored as text, with an empty Price column

The culprit here is a non-breaking space at the end of each price. Web pages use it a lot, and you can’t spot it because it looks exactly like a normal space.

Its code is 160, so CHAR(160) lets a formula find it and remove it.

Here is the formula:

=VALUE(SUBSTITUTE(B2:B11,CHAR(160),""))
VALUE, SUBSTITUTE, and CHAR(160) formula converting the copied prices into numbers

SUBSTITUTE replaces every CHAR(160) with nothing, which leaves text like $24.99. The VALUE function then converts that text into a number you can sum and format.

Important: The TRIM and CLEAN functions don’t remove the non-breaking space (code 160). TRIM only removes regular spaces (code 32), so you need SUBSTITUTE with CHAR(160) for this.

So these are six ways to use the CHAR function in Excel. The three codes worth remembering are 10 for a line break, 34 for a double quote, and 160 for the non-breaking space that comes in with web data.

I hope you found this article helpful.

List of All Excel Functions

Other Excel Articles You May Also Like:

Sumit Bansal

Sumit Bansal

13x Microsoft Excel MVP

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.