Skip to main content
Byte Array Tools

Byte Array to Base64 Converter

Convert a byte array to Base64 or URL-safe Base64, and decode Base64 back to a byte array in decimal, hex or code form.

Switch between raw bytes and Base64 in either direction - useful when an API, a JWT or a config file carries binary data as text.

Base64 makes data about a third larger - it is an encoding for transport, not compression or encryption.

What Is the Byte Array to Base64 Converter?

Base64 writes binary data using only letters, digits, + and /, so it can travel through JSON, email, URLs and config files. This tool converts a byte array to Base64 and Base64 back to a byte array, including the URL-safe variant used by JWTs and many web APIs.

When to Use It

  • An API expects a file or a key as Base64 and you have the raw bytes.
  • You received Base64 and need the bytes as an array for code or a test.
  • Checking a URL-safe Base64 value (with - and _) from a token.

How to Use It

  1. Choose the direction: Byte Array → Base64 or Base64 → Byte Array.
  2. Paste the input. Switching direction feeds the current result back in, so you can round-trip.
  3. For encoding, tick URL-safe if needed; for decoding, choose the array format.

Example

The bytes 0x42, 0x79, 0x74, 0x65, 0x61, 0x72, 0x79, 0xFB, 0xFF encode to Qnl0ZWFyefv_ in URL-safe Base64 - the standard form would be Qnl0ZWFyefv/. Nine bytes make exactly twelve characters, so no = padding is needed.

Understanding the Output

Every 3 bytes become 4 Base64 characters, so Base64 is about 33% larger than the data. When the length is not a multiple of 3, standard Base64 adds one or two = signs; URL-safe Base64 usually drops them.

Limitations

Base64 is an encoding, not encryption - anyone can decode it. To encode or decode text rather than bytes, the Base64 Encoder / Decoder is simpler; for images, use Image to Base64.

Frequently Asked Questions

A Base64 variant that replaces + with - and / with _ so the value can be used in URLs and file names without escaping, and usually drops the = padding. JWTs and many web APIs use it. The decoder here accepts both variants.

Base64 turns every 3 bytes into 4 characters. When the data length is not a multiple of 3, the last group is padded with one or two = signs. Nine bytes need no padding; ten bytes need two = signs.

No. Base64 is a reversible encoding that anyone can decode without a key. It is used to carry binary data through text-only channels, not to hide it. Use proper encryption for secrets.

The Base64 Encoder / Decoder works with text. This tool works with raw bytes, so it can handle binary data that is not valid text, and it outputs byte arrays for code.
Share this tool: