---
title: encodeBase64
description: |
  Encodes a string into its Base64 representation.
url: https://coralogix.com/docs/dataprime/language-reference/functions-reference/string/encodebase64/
product: dataengine
feature: DataPrime Language
feature_id: dataprime-language
feature_identifier: dataengine/dataprime-language
last_updated: '2026-10-21'
---

# `encodeBase64`

## Description

Encodes a string into its Base64 representation.

## Syntax

Like many functions in DataPrime, `encodeBase64` supports<!-- --> [two notations](https://coralogix.com/docs/dataprime/language-reference/functions-reference.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
encodeBase64(value: string): string
```

```
(value: string).encodeBase64(): string
```

## Arguments

| Name    | Type     | Required | Description                      |
| ------- | -------- | -------- | -------------------------------- |
| `value` | `string` | **true** | The string to encode into Base64 |

## Example

**Encode a URL into Base64**

Consider the following document:

```
{

    "path": "/home",

    "domain": "coralogix.com",

    "full_url": "https://coralogix.com/home"

}
```

Use `encodeBase64` to transform the URL into a Base64-encoded string:

### Example query

* Function notation
* Method notation

```
create full_url_encoded from encodeBase64(full_url)
```

```
create full_url_encoded from full_url.encodeBase64()
```

### Example output

```
{

    "path": "/home",

    "domain": "coralogix.com",

    "full_url": "https://coralogix.com/home",

    "full_url_encoded": "aHR0cHM6Ly9jb3JhbG9naXguY29tL2hvbWU="

}
```
