> This page location: String Functions > CHR
> Full Neon documentation index: https://neon.com/docs/llms.txt

# PostgreSQL CHR() Function

The PostgreSQL `CHR()` function converts an integer ASCII code to a character or a Unicode code point to a UTF8 character.

## Syntax

The following shows the syntax of the `CHR()` function:

```sql
CHR(num)
```

## Arguments

The `CHR()` function requires one argument:

**1) `num`**

The num argument is an integer that is converted to the corresponding ASCII code.

It could be a Unicode code point which is converted to a UTF8 character.

## Return Value

The `CHR()` function returns a character that corresponds the ASCII code value or Unicode code point.

## Examples

The following example shows how to use the `CHR()` function to get the characters whose ASCII code value is 65 and 97:

```sql
SELECT
    CHR(65),
    CHR(97);
```

The query returns character A for 65 and a for 97:

![PostgreSQL CHR - ASCII example](https://neon.com/postgresqltutorial/PostgreSQL-CHR-ASCII-example.png)
Here is an example of getting the UTF8 character based on the Unicode code point 937:

```sql
SELECT
    CHR(937);
```

The output for the Unicode code point 937 is Ω, which is what we expected.

![PostgreSQL CHR - Unicode example](https://neon.com/postgresqltutorial/PostgreSQL-CHR-Unicode-example.png)

## Remarks

To get the ASCII code or UTF-8 character of an integer, you use the [`ASCII()`](https://neon.com/postgresql/postgresql-string-functions/postgresql-ascii) function.

In this tutorial, you have learned how to use the PostgreSQL `CHR()` function to get the character based on its ASCII value or Unicode code point.

---

## Related docs (String Functions)

- [ASCII](https://neon.com/postgresql/postgresql-string-functions/postgresql-ascii)
- [CONCAT](https://neon.com/postgresql/postgresql-string-functions/postgresql-concat-function)
- [CONCAT_WS](https://neon.com/postgresql/postgresql-string-functions/postgresql-concat_ws)
- [FORMAT](https://neon.com/postgresql/postgresql-string-functions/postgresql-format)
- [INITCAP](https://neon.com/postgresql/postgresql-string-functions/postgresql-initcap)
- [LEFT](https://neon.com/postgresql/postgresql-string-functions/postgresql-left)
- [LENGTH](https://neon.com/postgresql/postgresql-string-functions/postgresql-length-function)
- [LOWER](https://neon.com/postgresql/postgresql-string-functions/postgresql-lower)
- [LPAD](https://neon.com/postgresql/postgresql-string-functions/postgresql-lpad)
- [LTRIM](https://neon.com/postgresql/postgresql-string-functions/postgresql-ltrim)
- [MD5](https://neon.com/postgresql/postgresql-string-functions/postgresql-md5)
- [POSITION](https://neon.com/postgresql/postgresql-string-functions/postgresql-position)
- [REGEXP_MATCHES](https://neon.com/postgresql/postgresql-string-functions/postgresql-regexp_matches)
- [REGEXP_REPLACE](https://neon.com/postgresql/postgresql-string-functions/regexp_replace)
- [REPEAT](https://neon.com/postgresql/postgresql-string-functions/postgresql-repeat)
- [REVERSE](https://neon.com/postgresql/postgresql-string-functions/postgresql-reverse)
- [REPLACE](https://neon.com/postgresql/postgresql-string-functions/postgresql-replace)
- [RIGHT](https://neon.com/postgresql/postgresql-string-functions/postgresql-right)
- [RPAD](https://neon.com/postgresql/postgresql-string-functions/postgresql-rpad)
- [RTRIM](https://neon.com/postgresql/postgresql-string-functions/postgresql-rtrim)
- [SPLIT_PART](https://neon.com/postgresql/postgresql-string-functions/postgresql-split_part)
- [SUBSTRING](https://neon.com/postgresql/postgresql-string-functions/postgresql-substring)
- [TO_CHAR](https://neon.com/postgresql/postgresql-string-functions/postgresql-to_char)
- [TO_NUMBER](https://neon.com/postgresql/postgresql-string-functions/postgresql-to_number)
- [TRANSLATE](https://neon.com/postgresql/postgresql-string-functions/postgresql-translate)
- [TRIM](https://neon.com/postgresql/postgresql-string-functions/postgresql-trim-function)
- [UPPER](https://neon.com/postgresql/postgresql-string-functions/postgresql-upper)
