Overview
This node provides functionality to encode text into Base64 format or decode a Base64 string back into plain text. It is useful in scenarios where data needs to be safely transmitted or stored in an ASCII string format, such as embedding binary data in JSON, sending data over protocols that are not binary-safe, or decoding received Base64 encoded content.
Practical examples:
- Encoding user input or file contents to Base64 before sending it to an API that requires Base64 encoded payloads.
- Decoding Base64 encoded responses or data fields from external services to obtain the original readable text.
Properties
| Name | Meaning |
|---|---|
| Base64 | The Base64 encoded string to decode to text |
(Note: This property is shown only when the "Decode" operation is selected.)
Output
The node outputs an array of items, each containing a json object with a single field:
result: A string representing the decoded text from the provided Base64 input.
If the operation were "Encode" (not requested here), the output would similarly contain the Base64 encoded string.
Dependencies
- No external services or API keys are required.
- The node uses Node.js Buffer class for encoding and decoding operations, which is available in the n8n runtime environment by default.
Troubleshooting
- Invalid Base64 string error: If the input Base64 string is malformed or invalid, the node throws an error indicating "Invalid Base64 string". To resolve this, ensure the input string is correctly Base64 encoded without extra characters or missing padding.
- Empty or missing input will cause the node to fail or produce empty output; always provide valid Base64 strings when using the decode operation.