# BYTE_LENGTH

Returns the number of bytes used by a string. All strings are in UTF-8, so a single character can use multiple bytes.

## Syntax

`BYTE_LENGTH(string)`

### Parameters

#### string

String expression to measure. If the value is `null`, the function returns `null`.

## Examples

Calculates the number of characters and the number of bytes for each city name in airports located in India.

```esql
FROM airports
| WHERE country == "India"
| KEEP city
| EVAL fn_length = LENGTH(city), fn_byte_length = BYTE_LENGTH(city)
```
