Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

CHAR Formula in Excel: How to Use It Step by Step

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The CHAR formula in Excel converts a number into the character it represents in your computer's character set, based on the ANSI (Windows-1252) code. For example, =CHAR(65) returns a capital A, and =CHAR(10) returns a line break. It takes just one argument, so it is one of the simplest functions in Excel — but it becomes genuinely powerful when you combine it with other functions to insert line breaks, symbols, or clean up text.

What You'll Need

  • A copy of Excel on Windows, Mac, or Excel for the web (CHAR works in all of them)
  • A number between 1 and 255 — anything outside that range returns a #VALUE! error

Step-by-Step

  1. Open Excel and click the cell where you want the character to appear.
  2. Type =CHAR( and then the code number. For example: =CHAR(65)
  3. Press Enter. The cell displays A, because 65 is the ANSI code for an uppercase A.
  4. Try a few other common codes: =CHAR(9) gives a tab character, =CHAR(10) gives a line break, =CHAR(32) gives a space, =CHAR(176) gives the degree symbol (°), and =CHAR(169) gives the copyright symbol (©).
  5. To insert a line break inside a formula, combine CHAR(10) with concatenation: =A1&CHAR(10)&B1 — this joins the text from A1 and B1 with a line break between them.
  6. For the line break to actually display, select the cell, then on the Home tab click Wrap Text. Without Wrap Text, the break exists but the cell shows everything on one line (or the text is clipped).
  7. To reverse the process — get the code from a character — use the CODE function: =CODE("A") returns 65.
  8. To remove special characters from text, use CHAR with SUBSTITUTE. For example, to strip line breaks: =SUBSTITUTE(A1,CHAR(10),"") replaces every line break in A1 with nothing.
  9. Check your results. If a cell shows #VALUE!, your number was outside the 1–255 range or wasn't a number at all.

Common Mistakes

  • Using a number outside 1–255. CHAR(256) or CHAR(0) returns a #VALUE! error — the limit is hard.
  • Passing text instead of a number. =CHAR("A") fails; if your number is stored as text, wrap it in VALUE first: =CHAR(VALUE(A1)).
  • Forgetting Wrap Text. This is the number one reason people think CHAR(10) "doesn't work" — the line break is there, it just isn't visible.
  • Expecting Unicode characters. CHAR only covers the ANSI set (1–255), so it cannot produce emoji, accented characters outside that set, or other Unicode symbols. Use UNICHAR instead for those, with a Unicode code point, e.g. =UNICHAR(8364) for the euro sign.
  • Confusing CHAR(10) with CHAR(13). Windows uses CHAR(13)+CHAR(10) for line breaks in some contexts, while a lone CHAR(13) often appears as a small box. When in doubt, use CHAR(10) in Excel formulas.

Tips

  • Pair CHAR with CODE to identify mystery characters. If =CODE(MID(A1,1,1)) returns 160, you've found a non-breaking space (common in data copied from the web) — remove it with =SUBSTITUTE(A1,CHAR(160)," ").
  • Build a quick reference table by putting numbers 1–255 in column A and =CHAR(A1) dragged down column B, so you can see every character at a glance.
  • Use CHAR(34) to insert double quotes inside a formula, which avoids messy quote-escaping: ="He said "&CHAR(34)&"hello"&CHAR(34).
  • Combine CHAR(10) with TEXTJOIN to stack multiple values in one cell: =TEXTJOIN(CHAR(10),TRUE,A1:A5).

Troubleshooting

#VALUE! error: your argument is not a whole number between 1 and 255. Check the cell you referenced — it may contain text or be empty.

Line break not showing: select the cell and turn on Wrap Text from the Home tab. Also confirm the formula actually contains CHAR(10), not CHAR(13).

Odd boxes or unexpected symbols: you may be using a code that maps to an unprintable control character (codes 1–31 mostly are). Only some of these, like 9, 10, and 13, have useful effects.

Wrong character on Mac or in other locales: the ANSI character set can vary slightly by system. Characters in the upper range (127–255) may differ; stick to well-known codes like 176 (°) or verify with the CODE function.

Need an emoji or non-ANSI character: CHAR cannot do it — switch to UNICHAR with the Unicode code point instead.

Frequently Asked Questions

What is the difference between CHAR and CODE?

They are opposites. CHAR turns a number into a character (=CHAR(65) → A), while CODE turns a character into its number (=CODE("A") → 65).

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

Use CHAR(10): =A1&CHAR(10)&B1, then enable Wrap Text on the cell so the break is visible.

What does CHAR(10) mean?

It is the line feed character — the standard line break used inside Excel cells and formulas.

Can CHAR return an emoji?

No. CHAR is limited to ANSI codes 1–255. Use UNICHAR with a Unicode code point for emoji and other symbols.

Why does CHAR(160) matter?

Code 160 is a non-breaking space, which looks like a normal space but breaks formulas like TRIM and VLOOKUP matches. Replace it with SUBSTITUTE(A1,CHAR(160)," ").

Does CHAR work the same on Mac and Windows?

The function works on both, but a few codes in the upper range can map to different characters. Common codes like 10, 34, and 176 behave consistently.