# To base64

## Description

This operation is used to encode data into a Base64 string. Base64 is a binary-to-text encoding method commonly used to encode binary data (like images or files) into text that can be easily transmitted over text-based protocols such as email, JSON, or XML. It’s also used for data storage, ensuring the data remains ASCII-safe.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

![](/files/PLlLS9WDthpZu0nbKCNG) - The string you want to encode.

### Output data

![](/files/FiO6hMIDNPuoHDSTAxHC) - Resulting Base64 string.

***

## Example

Suppose you want to **encode** a series of events into **Base64**:

1. In your Pipeline, open the required [Action](https://onum.gitbook.io/onum-docs/the-workspace/pipelines/actions) configuration and select the input **Field**.
2. In the **Operation** field, choose **To Base64**.
3. Give your **Output field** a name and click **Save**. The values in your input field will be encoded. For example:

<pre><code><strong>Hello, Onum! -> IEhlbGxvLCBPbnVtIQ==
</strong></code></pre>

{% hint style="info" %}
You can try out operations with specific values using the **Input** field above the operation. You can enter the value in the example above and check the result in the **Output** field.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/pipelines/actions/transformation/field-transformation/field-transformation-operations/data-format/to-base64.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
