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.
Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked
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
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.
Reproducible example (tested in LibreOffice Calc)
This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.
=CHAR(65)
Expected result: A.
Return the character with code 65.
If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.