> ## 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.

# CONV

> Converts an integer represented as text from one base to another.

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

Returns NULL for NULL arguments, from\_base outside 2 through 36, or abs(to\_base) outside 2 through 36.

## Syntax

### Scalar

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

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | STRING | Yes | The integer text to convert. |
| from\_base | INTEGER | Yes | The input base. 2 through 36. |
| to\_base | INTEGER | Yes | The output base; a negative base requests a signed 64-bit interpretation. Absolute value 2 through 36. |

## Returns

* Type: STRING
* Possible values: Uppercase base digits 0-9 and A-Z, with a minus sign for negative signed output.
* NULL behavior: Returns NULL for NULL arguments, from\_base outside 2 through 36, or abs(to\_base) outside 2 through 36.

## Properties

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

## Usage notes

* Leading and trailing whitespace is stripped. An optional sign is accepted.
* Parsing stops at the first digit that is invalid in from\_base. An empty or initially invalid digit sequence yields zero.
* Input is interpreted as an unsigned 64-bit value. Negative text wraps within that range before the result is interpreted as signed or unsigned.

## Examples

### Value and NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT conv('100', 2, 10) AS decimal, conv('FF', 16, 10) AS hexadecimal, conv('123Z', 10, 16) AS prefix;
```

| decimal | hexadecimal | prefix |
| - | - | - |
| 4 | 255 | 7B |

### Convert between bases

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT conv('ff', 16, 10) AS decimal_text, conv('15', 10, 2) AS binary_text;
```

| decimal\_text | binary\_text |
| - | - |
| 255 | 1111 |

## Limitations

* Input beyond the unsigned 64-bit range raises an error.


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