Skip to main content

Base64 Decode

Decodes Base64 encoded text back to its original format.

Common Properties​

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Inputs​

  • Text - The Base64 encoded string to decode. Cannot be empty.

Options​

This node does not have any options.

Outputs​

  • Result - The decoded plain text string.

How It Works​

The Base64 Decode node converts Base64 encoded strings back to their original text format. When executed, the node:

  1. Receives a Base64 encoded string through the Text input
  2. Decodes the Base64 string to bytes using standard Base64 decoding
  3. Converts the bytes to a text string
  4. Outputs the decoded string through the Result output

This node is the reverse operation of Base64 Encode and is essential for processing Base64 encoded data.

Example Usage​

Example 1: Decoding HTTP Authentication​

Decode a Basic Authentication header value:

// Input text: "dXNlcm5hbWU6cGFzc3dvcmQ="
// Output: "username:password"

Example 2: Decoding API Response​

Decode Base64 encoded data from an API response:

// Input text: "SGVsbG8gV29ybGQh"
// Output: "Hello World!"

Example 3: Decoding Email Content​

Decode Base64 encoded email attachment or content:

// Input text: "dXNlckBleGFtcGxlLmNvbTpwQHNzdzByZCE="
// Output: "user@example.com:p@ssw0rd!"

Requirements​

  • Valid Base64 encoded string as input
  • Input string must not be empty

Error Handling​

The node will return specific errors in the following cases:

  • ErrInvalidArg - When the input text is empty
  • ErrInvalidArg - When the input string is not valid Base64 format

Usage Tips​

  • Validation: Always ensure the input is valid Base64 before decoding
  • Pair with Encode: Use this node to decode data that was previously encoded with Base64 Encode
  • API Responses: Many APIs return Base64 encoded data, especially for binary content
  • Email Processing: Email attachments are often Base64 encoded
  • Error Handling: Enable "Continue On Error" when processing potentially invalid Base64 data
  • Data Verification: Verify the decoded content format matches expectations

Common Use Cases​

  1. API Integration: Decode Base64 encoded responses from REST APIs
  2. Email Automation: Decode Base64 encoded email attachments or content
  3. File Processing: Decode Base64 encoded file contents received from web services
  4. Configuration: Decode Base64 encoded configuration values or credentials
  5. Data Extraction: Extract original data from Base64 encoded strings in web scraping

Common Errors and Solutions​

Invalid Base64 String​

Problem: Error message "Invalid Base64 string"

Solutions:

  • Verify the input string is properly Base64 encoded
  • Check for missing or extra characters in the encoded string
  • Ensure there are no line breaks or whitespace in the input
  • Verify the string wasn't truncated during transmission

Empty Input​

Problem: Error message "Base64 text cannot be empty"

Solutions:

  • Verify the input variable contains data
  • Check if the previous node properly set the output
  • Add conditional logic to handle empty values

Unexpected Output​

Problem: Decoded text doesn't match expected format

Solutions:

  • Verify the correct encoding was used (Standard vs URL-safe Base64)
  • Check if the data was double-encoded
  • Ensure character encoding matches (UTF-8, ASCII, etc.)

Notes​

  • Base64 decoding reverses the approximately 33% size increase from encoding
  • This node does NOT decrypt data - it only decodes Base64 format
  • Invalid Base64 strings will cause an error
  • Leading/trailing whitespace in the input may cause decoding errors
  • The node uses standard Base64 decoding (not URL-safe variant)