Skip to main content
Calculates the length of the input string in bytes. For TEXT, a character whose UTF-8 encoding uses more than one byte adds that many bytes to the total. To count characters (Unicode code points) instead of bytes, use LENGTH.

Syntax

Parameters

Return Type

INTEGER

Example

Use the OCTET_LENGTH to find the length of any string in bytes, such as:

Rows: 1Execution time: 5.21ms

OCTET_LENGTH returns 4 because the UTF-8 encoding of 🔥 has the byte sequence 0xF0 0x9F 0x94 0xA5, while LENGTH returns 1 because it counts the single character.