NodeCrypto Help

Bytes to Base64

Category: Data Conversion & Encoding · Node Type ID: converter-bytes-to-base64

Encodes raw byte array into Base64 / Base64URL string

Overview

Encodes a raw byte array (Uint8Array) into an ASCII string using RFC 4648 Base64 (A-Z, a-z, 0-9, +, /) or URL-safe Base64URL (- and _ in place of + and /).

You can also control whether trailing = padding characters are included or stripped, which is required when constructing JWT segments, JWK fields, or URL query tokens.

When to Use

Parameter Configuration

Parameter (ID)Type & DefaultVisibility ConditionDescription & Options
Base64 Variant
variant
select
Default: standard
Always visible Selects RFC 4648 §4 standard alphabet (+/) or RFC 4648 §5 url_safe alphabet (-_).
  • standard: Standard (+/)
  • url_safe: URL-Safe (-_)
Include Padding (=)
padding
boolean
Default: true
Supports Variable Reference ($var: bool)
Always visible When enabled (true), pads the output string with = so its length is a multiple of 4. Disable for unpadded Base64URL tokens.

Port I/O Specification

See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.

Input Ports

Port Nature: Fixed Input Ports (1 total).

Port NamePort IDData TypeRequiredVisibility ConditionDescription
Bytes In bytes Bytes Required Always visible Raw byte array (Uint8Array) to encode.

Output Ports

Port Nature: Fixed Output Ports (1 total).

Port NamePort IDData TypeVisibility ConditionDescription
Base64 Out string String Always visible Encoded Base64 or Base64URL string.

Error Cases

This node has no runtime failure cases (errorProfile: none) and always succeeds for any valid typed input.

Examples

Encoding a Signature as Unpadded Base64URL for JWT

Format a 64-byte Ed25519 signature for use in a JWT token.

  1. Connect the Signature output of Ed25519 Sign to Bytes to Base64.
  2. Set Base64 Variant to URL-Safe (-_) and uncheck Include Padding (=).