CHAR Function (LibreOffice Calc)
The CHAR function returns the character corresponding to a given numeric code point. It is commonly used for generating special characters, symbols, control characters, and formatting elements.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the CHAR Function Does ▾
- Converts a numeric code into a character
- Supports ASCII and extended character sets
- Useful for formatting, text construction, and symbol generation
- Works with UNICHAR for full Unicode support
Syntax ▾
CHAR(number)
Arguments
- number:
A numeric code between 1 and 255 (ASCII / extended Latin‑1 range).
Basic Examples ▾
Standard ASCII characters
=CHAR(65)
→ "A"
=CHAR(97)
→ "a"
Punctuation
=CHAR(33)
→ "!"
Line break (LF)
=CHAR(10)
Tab character
=CHAR(9)
Advanced Examples ▾
Combine with CONCAT for multi-line text
="Line 1" & CHAR(10) & "Line 2"
Insert a bullet symbol (extended ASCII)
=CHAR(149)
Generate a sequence of characters
=CHAR(64 + ROW())
→ A, B, C, ...
Create a CSV-style line break
=A1 & CHAR(10) & B1
Use with REPT to build visual structures
=REPT(CHAR(45); 20)
→ "--------------------"
Combine with UNICHAR for full Unicode support
=CHAR(169) & " " & UNICHAR(0x1F4A1)
Edge Cases and Behavior Details ▾
CHAR returns a text string
Accepts:
- Integer values 1–255
- Decimal values (floored automatically)
Behavior details
- Values outside 1–255 → Err:502
- CHAR uses the system’s current character encoding
- For full Unicode, use UNICHAR instead
CHAR(10) creates a line break
Cell must be formatted as Wrap Text to display it.
CHAR of an error → error propagates
Common Errors and Fixes ▾
Err:502 — Invalid argument
Cause:
- Value < 1 or > 255
- Non-numeric input
Fix:
- Clamp values to 1–255
- Use VALUE() to convert text
Character displays incorrectly
Cause:
- System encoding limitations
Fix:
- Use UNICHAR for Unicode characters
Best Practices ▾
- Use CHAR for ASCII and control characters
- Use UNICHAR for Unicode symbols and emojis
- Combine with CONCAT, TEXTJOIN, or REPT for formatting
- Use CHAR(10) for line breaks in wrapped cells
- Validate numeric input to avoid errors
CHAR is perfect for generating formatting characters, line breaks, and ASCII symbols — but switch to UNICHAR when you need full Unicode support.
Related Patterns and Alternatives ▾
- CODE — reverse of CHAR
- UNICHAR / UNICODE — full Unicode support
- CONCAT / TEXTJOIN — build complex strings
- REGEX — manipulate character patterns
By mastering CHAR, you can build dynamic text structures, formatting helpers, and symbol‑rich spreadsheets in LibreOffice Calc.