> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/string-functions/chr.md).

# CHR

## Syntax

```bnf
CHR(N)
```

## Description

`CHR()` interprets each argument N as an integer and returns a [VARCHAR(1)](/docs/server/reference/data-types/string-data-types/varchar.md) string consisting of the character given by the code values of the integer. The character set and collation of the string are set according to the values of the [character\_set\_database](/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-character_sets-table.md) and [collation\_database](/docs/server/reference/system-tables/information-schema/information-schema-tables/information-schema-collations-table.md) system variables.

`CHR()` is similar to the [CHAR()](/docs/server/reference/sql-functions/string-functions/char-function.md) function, but only accepts a single argument.

`CHR()` is available in all [sql\_modes](/docs/server/server-management/variables-and-modes/sql_mode.md).

## Examples

```sql
SELECT CHR(67);
+---------+
| CHR(67) |
+---------+
| C       |
+---------+

SELECT CHR('67');
+-----------+
| CHR('67') |
+-----------+
| C         |
+-----------+

SELECT CHR('C');
+----------+
| CHR('C') |
+----------+
|          |
+----------+
1 row in set, 1 warning (0.000 sec)

SHOW WARNINGS;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: 'C' |
+---------+------+----------------------------------------+
```

## See Also

* [Character Sets and Collations](/docs/server/reference/data-types/string-data-types/character-sets.md)
* [ASCII()](/docs/server/reference/sql-functions/string-functions/ascii.md) - Return ASCII value of first character
* [ORD()](/docs/server/reference/sql-functions/string-functions/ord.md) - Return value for character in single or multi-byte character sets
* [CHAR()](/docs/server/reference/sql-functions/string-functions/char-function.md) - Similar function which accepts multiple integers

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
