> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CHAR_LENGTH

> Counts Unicode characters in a string.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

**Aliases:** [`character_length`](/query/sql/functions/string/character_length)

Returns NULL for NULL input.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
char_length(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | The string to measure. |

## Returns

* Type: INTEGER; BIGINT for strings using large-string storage
* Possible values: A nonnegative count of Unicode code points; zero for an empty string.
* NULL behavior: Returns NULL for NULL input.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Units

* Input unit: UTF-8 string
* Output unit: Unicode code points
* octet\_length counts UTF-8 bytes instead.

## Usage notes

* A combined visible grapheme can contain several Unicode code points.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT char_length('josé') AS characters, char_length('') AS empty_value;
```

| characters | empty\_value |
| - | - |
| 4 | 0 |

### Unicode characters and trailing spaces

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT char_length('é猫') AS character_count, char_length('cat ') AS with_space;
```

| character\_count | with\_space |
| - | - |
| 2 | 4 |

## Limitations

* Some large-string columns return a BIGINT count even when query tools report INTEGER.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.