﻿---
title: ES|QL string functions
description: ES|QL supports these string functions: 
url: https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# ES|QL string functions
ES|QL supports these string functions:
- [`BIT_LENGTH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/bit_length)
  Returns the bit length of a string.
- [`BYTE_LENGTH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/byte_length)
  Returns the byte length of a string.
- [`CHUNK`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/chunk) <applies-to>Elastic Stack: Preview since 9.3</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Splits a text field into smaller chunks.
- [`CONCAT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/concat)
  Concatenates two or more strings.
- [`CONTAINS`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/contains) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  Checks whether a keyword substring is contained within another string.
- [`ENDS_WITH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/ends_with)
  Checks whether a keyword string ends with another string.
- [`FROM_BASE64`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/from_base64)
  Decodes a base64 string.
- [`HASH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/hash)
  Computes the hash of the input using a specified algorithm.
- [`JSON_EXTRACT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/json_extract) <applies-to>Elastic Stack: Preview since 9.4</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Extracts a value from a JSON string using JSONPath syntax.
- [`LEFT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/left)
  Returns a substring of the specified length from the left side of a string.
- [`LENGTH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/length)
  Returns the character length of a string.
- [`LOCATE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/locate)
  Returns the position of a keyword substring within another string.
- [`LTRIM`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/ltrim)
  Removes leading whitespaces from a string.
- [`MD5`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/md5)
  Computes the MD5 hash of the input.
- [`REPEAT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/repeat)
  Returns a string repeated a specified number of times.
- [`REPLACE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/replace)
  Replaces regular expression matches in a string with a replacement string.
- [`REVERSE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/reverse)
  Returns the input string in reverse order.
- [`RIGHT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/right)
  Returns a substring of the specified length from the right side of a string.
- [`RTRIM`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/rtrim)
  Removes trailing whitespaces from a string.
- [`SHA1`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/sha1)
  Computes the SHA1 hash of the input.
- [`SHA256`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/sha256)
  Computes the SHA256 hash of the input.
- [`SPACE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/space)
  Returns a string made of the specified number of spaces.
- [`SPLIT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/split)
  Splits a single valued string into multiple strings.
- [`STARTS_WITH`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/starts_with)
  Checks whether a keyword string starts with another string.
- [`SUBSTRING`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/substring)
  Returns a substring of a string, specified by a start position and an optional length.
- [`TO_BASE64`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/to_base64)
  Encodes a string to a base64 string.
- [`TO_LOWER`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/to_lower)
  Returns a new string converted to lower case.
- [`TO_UPPER`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/to_upper)
  Returns a new string converted to upper case.
- [`TRIM`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/trim)
  Removes leading and trailing whitespaces from a string.
- [`URL_DECODE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/url_decode) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  Decodes a URL-encoded string.
- [`URL_ENCODE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/url_encode) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  URL-encodes a string with spaces encoded as plus signs.
- [`URL_ENCODE_COMPONENT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/reference/query-languages/esql/functions-operators/string-functions/url_encode_component) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  URL-encodes a string with spaces encoded as percent codes.