Skip to main content
FreeOnlineTools

Base64 Encode & Decode

Encode and decode Base64 with UTF-8 support. Instant, private, browser-based. No upload, no signup.

Local processing
0Input chars
0Output chars

What is Base64 Encode & Decode?

Base64 is a binary-to-text encoding scheme defined by RFC 4648 that converts binary data into a set of 64 ASCII characters (A-Z, a-z, 0-9, +, /). It is NOT encryption — it is fully reversible and requires no key. Base64 is commonly used for MIME email, Data URLs, JWT payloads, and embedding binary resources in JSON/XML.

How It Works

Base64 processes input data in 3-byte (24-bit) blocks, splitting each block into four 6-bit groups. Each 6-bit value maps to one of 64 characters. If the input length is not divisible by 3, padding (=) is appended. UTF-8 text is first encoded to bytes before Base64 encoding.

Common Use Cases

  • API token encoding — pass binary tokens safely in HTTP headers
  • Email attachments — MIME encodes binary files as Base64 for text-based transport
  • Data URLs — embed small images directly in HTML/CSS as Base64 strings
  • JWT tokens — the header and payload sections use Base64URL encoding

Technical Details

Standard: RFC 4648. Character set: A-Z, a-z, 0-9, +, / (URL-safe variant uses - and _). Padding: one or two = characters. A 1MB input produces ~1.33MB Base64 output (33% size increase). Base64URL (used in JWT) replaces +/ with -_ and omits padding.

How to Use

Enter your input above. The result updates automatically. Use the copy button to copy the result.

Privacy

All processing happens in your browser. Your data is never uploaded to any server.

FAQ

Is Base64 encoding encryption?

No. Base64 is an encoding scheme, not encryption. It converts data to an ASCII-safe format but anyone can decode it without a key.

Does this tool upload my data?

No. All processing happens locally in your browser. Your text never leaves your device.

What if my Base64 string is invalid?

The tool will show an error message indicating the input is not valid Base64. Check for whitespace or non-Base64 characters.

Does this support UTF-8?

Yes, both the encoder and decoder handle UTF-8 encoded text correctly, including emoji and multi-byte characters.

Why does Base64 make data larger?

Base64 encodes every 3 bytes into 4 characters, causing a ~33% size increase. This overhead is the trade-off for text-only compatibility.

What is Base64URL?

Base64URL is a URL-safe variant (RFC 4648 section 5) that replaces + with - and / with _, and omits padding. It is used in JWT tokens and URL parameters.

Related Tools