---
schema_version: "1"
id: bde0a187e7e7bd67fbc0c33608816b4d925e9d12e1f4ac0429bfc3c1a9b7261f
title: TO_BASE64
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/to-base64.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/to-base64.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e3a524f19989c3fce98e78b488fdfea16e36825d043965e32655a250a59f1ec7
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `TO_BASE64`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Converts data to its equivalent base64 representation.

## Syntax

```sql
to_base64(<data>)
```

## Arguments

### Required

- `<data>`: The data to encode (int, bigint, or bytea).

## Returns

Returns a text value containing the base64-encoded representation of the data.

## Examples

### Convert to Base64

Encode an integer to base64.

```sql
SELECT to_base64(2147483647) AS result;
```

Returns `'f////w=='`.

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
