Base64 Encode & Decode Online
Data & EncodingFree online Base64 encoder and decoder. Encode text to Base64 or decode Base64 to text instantly in your browser - full Unicode support, no server, no tracking.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters: the uppercase letters A–Z, the lowercase letters a–z, the digits 0–9, and the symbols + and /. It was designed to carry data stored in binary formats across channels that only reliably support plain text. This online Base64 encoder and decoder converts text to Base64 and decodes Base64 back to readable text entirely in your browser, with full Unicode (UTF-8) support so accented characters, emoji, and non-Latin scripts all round-trip correctly.
How Base64 Encoding Works
Base64 splits the input into groups of 3 bytes (24 bits) and then re-groups those bits into four 6-bit chunks. Each 6-bit chunk indexes into the 64-character alphabet to produce one output character, so every 3 bytes become 4 characters - roughly a 33% size increase. When the input length is not a multiple of 3, the final group is padded with one or two = characters so the output length stays a multiple of four.
When Do Backend Developers Use Base64?
- Encoding credentials for HTTP Basic Authentication headers
- Embedding small images or files as data URIs in JSON or HTML
- Decoding Base64-encoded API responses and webhook payloads
- Inspecting the header and payload sections of JWT tokens
- Transmitting binary data through text-only protocols like SMTP
- Storing config values in environment variables or YAML
Base64 vs Base64URL
Standard Base64 uses + and / as the 63rd and 64th characters and = for padding. Base64URL replaces these with - and _ and omits the padding, making the output safe to drop into URLs, filenames, and query parameters without escaping. JWT tokens encode their header and payload segments with Base64URL.
Encode & Decode Base64 in Code
The same conversions this tool performs are one-liners in most languages:
# Python
import base64
base64.b64encode(b"hello").decode() # 'aGVsbG8='
base64.b64decode("aGVsbG8=").decode() # 'hello'
// Node.js
Buffer.from("hello").toString("base64") // 'aGVsbG8='
Buffer.from("aGVsbG8=", "base64").toString() // 'hello'
# Shell (coreutils)
echo -n hello | base64 # aGVsbG8=
echo aGVsbG8= | base64 -d # helloHow to Use This Tool
- Choose Encode to convert plain text to Base64, or Decode to convert Base64 back to text
- Paste your input - the result appears instantly as you type
- Click Copy to grab the output, or Swap to reverse the operation
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string without a key. Never use Base64 to protect sensitive data - use proper encryption (AES-256, etc.) instead.
Why is my Base64 output larger than the input?
Base64 encodes every 3 bytes of input into 4 ASCII characters, resulting in roughly 33% size overhead. This is the trade-off for representing binary data in a text-safe format.
Does this tool send my data to a server?
No. All encoding and decoding runs entirely in your browser using JavaScript. No data is transmitted over the network. You can verify this by opening your browser's Network tab.
What is the difference between Base64 and Base64URL?
Standard Base64 uses + and / and pads with =. Base64URL replaces them with - and _ and drops the padding, making it safe for URLs, filenames, and query parameters. JWT tokens use Base64URL.