---
title: BASE64_ENCODE
url: https://www.tines.com/docs/formulas/functions/base64-encode/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# BASE64_ENCODE

*[View on tines.com](https://www.tines.com/docs/formulas/functions/base64-encode/)*

Encode text or objects using the Base64 encoding algorithm. Objects are automatically converted to JSON strings before encoding. By default this complies with RFC 4648. Set strict: FALSE for RFC 2045 compliant encoding.

**Categories:** Data Parsing/Conversion

## Syntax

```
BASE64_ENCODE(text_or_object, [strict: TRUE])
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": "Hello world"
  }
}
```

Formula:

```
BASE64_ENCODE(my_action.message)
```

Output:

```json
"SGVsbG8gd29ybGQ="
```

### Example 2

Input:

```json
{
  "my_action": {
    "object": {
      "message": {
        "body": "Hello World!",
        "from": "Tines",
        "to": "World"
      }
    }
  }
}
```

Formula:

```
BASE64_ENCODE(my_action.object)
```

Output:

```json
"eyJib2R5IjoiSGVsbG8gV29ybGQhIiwiZnJvbSI6IlRpbmVzIiwidG8iOiJXb3JsZCJ9"
```

### Example 3

Input:

```json
{
  "my_action": {
    "long_message": "This is a very long message that will produce base64 output with line breaks when encoded with strict: FALSE"
  }
}
```

Formula:

```
BASE64_ENCODE(my_action.long_message, strict: FALSE)
```

Output:

```json
"VGhpcyBpcyBhIHZlcnkgbG9uZyBtZXNzYWdlIHRoYXQgd2lsbCBwcm9kdWNlIGJhc2U2NCBv\ndXRwdXQgd2l0aCBsaW5lIGJyZWFrcyB3aGVuIGVuY29kZWQgd2l0aCBzdHJpY3Q6IEZBTFNF\n"
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "2",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "hello world"
        }
      },
      "position": {
        "x": 1635,
        "y": 2070
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "BASE64_ENCODE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "base64_encode": "=BASE64_ENCODE(my_action.message)"
        }
      },
      "position": {
        "x": 1635,
        "y": 2145
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
