﻿---
title: ES|QL type conversion functions
description: ES|QL supports these type conversion functions: 
url: https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# ES|QL type conversion functions
<tip>
  ES|QL supports implicit casting from string literals to certain data types. Refer to [implicit casting](https://www.elastic.co/docs/reference/query-languages/esql/esql-implicit-casting) for details.
</tip>

ES|QL supports these type conversion functions:
- [`TO_AGGREGATE_METRIC_DOUBLE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_aggregate_metric_double) <applies-to>Elastic Stack: Preview since 9.2</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a numeric value to an aggregate_metric_double.
- [`TO_BOOLEAN`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_boolean)
  Converts a value to a boolean.
- [`TO_CARTESIANPOINT`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_cartesianpoint)
  Converts a value to a cartesian_point.
- [`TO_CARTESIANSHAPE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_cartesianshape)
  Converts a value to a cartesian_shape.
- [`TO_COUNTER`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_counter) <applies-to>Elastic Stack: Generally available since 9.5</applies-to>
  Converts a numeric value to its counter type equivalent.
- [`TO_DATEPERIOD`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_dateperiod)
  Converts a value to a date_period.
- [`TO_DATETIME`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_datetime)
  Converts a value to a date.
- [`TO_DATE_NANOS`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_date_nanos)
  Converts a value to a nanosecond-resolution date.
- [`TO_DATE_RANGE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_date_range) <applies-to>Elastic Stack: Preview since 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to a date_range.
- [`TO_DEGREES`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_degrees)
  Converts a number in radians to degrees.
- [`TO_DENSE_VECTOR`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_dense_vector) <applies-to>Elastic Stack: Preview since 9.2</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts numbers or a hexadecimal string to a dense_vector.
- [`TO_DOUBLE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_double)
  Converts a value to a double.
- [`TO_DOUBLE_RANGE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_double_range) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to a double_range.
- [`TO_EXPONENTIAL_HISTOGRAM`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_exponential_histogram) <applies-to>Elastic Stack: Generally available since 9.4</applies-to>
  Converts histogram-like values to an exponential histogram.
- [`TO_GAUGE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_gauge) <applies-to>Elastic Stack: Generally available since 9.5</applies-to>
  Converts a counter value to its gauge numeric equivalent.
- [`TO_GEOHASH`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_geohash) <applies-to>Elastic Stack: Preview</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to a geohash.
- [`TO_GEOHEX`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_geohex) <applies-to>Elastic Stack: Preview</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to a geohex.
- [`TO_GEOPOINT`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_geopoint)
  Converts a value to a geo_point.
- [`TO_GEOSHAPE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_geoshape)
  Converts a value to a geo_shape.
- [`TO_GEOTILE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_geotile) <applies-to>Elastic Stack: Preview</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to a geotile.
- [`TO_INTEGER`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_integer)
  Converts a value to an integer.
- [`TO_IP`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_ip)
  Converts a string to an IP value.
- [`TO_LONG`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_long)
  Converts a value to a long.
- [`TO_RADIANS`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_radians)
  Converts a number in degrees to radians.
- [`TO_RANGE`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_range) <applies-to>Elastic Stack: Preview since 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Constructs a range from two boundary values.
- [`TO_STRING`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_string)
  Converts a value to a string.
- [`TO_TDIGEST`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_tdigest) <applies-to>Elastic Stack: Generally available since 9.4, Elastic Stack: Preview in 9.3</applies-to>
  Converts an untyped histogram to a TDigest.
- [`TO_TEXT`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_text) <applies-to>Elastic Stack: Preview in 9.5</applies-to> <applies-to>Elastic Cloud Serverless: Generally available</applies-to>
  Converts a value to text.
- [`TO_TIMEDURATION`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_timeduration)
  Converts a value to a time_duration.
- [`TO_UNSIGNED_LONG`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_unsigned_long) <applies-to>Elastic Stack: Preview</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Converts a value to an unsigned long.
- [`TO_VERSION`](https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/type-conversion-functions/to_version)
  Converts a string to a version value.