> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Decoding Hexadecimal Strings To Integers

To turn hex values into decimals, use our UDF:

```sql theme={null}
select common.udfs.js_hextoint_secure('0x10') -- returns '16'
```

If the number is known to be little-endian formatted, use:

```
select common.udfs.js_hextoint_littleendian_secure('0x10') -- returns '256'
```

Since blockchain numbers can be really big and exceed the size limit of a numerical column on Snowflake, our UDF returns strings.

But you can convert it by casting the return value to int:

```sql theme={null}
select common.udfs.js_hextoint_secure('0x10')::int -- returns 16
```
