Skip to main content
Developer, Web & Image Tools

Base64 Encode / Decode

Encode text and binary strings into Base64 ASCII format and decode Base64 strings back to plain text.

What is the Base64 Encode / Decode?

The Base64 Encode / Decode utility converts plain text, authorization credentials, and arbitrary data strings into standard Base64 representation (RFC 4648) and decodes Base64 strings back into original human-readable text. It features full UTF-8 character encoding support, ensuring international accented letters and emojis do not get corrupted.

Base64 is a binary-to-text encoding scheme designed to transmit binary data over communication channels that are fundamentally textual (such as email via MIME, HTTP Basic Authentication headers, data URIs for inline images, and cryptographic signatures). By converting 8-bit bytes into a safe 64-character ASCII set, it guarantees data integrity during transmission.

How to Use the Base64 Encode / Decode

  1. Select Mode: Choose either Encode (Text → Base64) or Decode (Base64 → Text).
  2. Enter Content: Type or paste your data into the input workspace.
  3. Live Translation: The output automatically renders in real time as you type.
  4. Copy or Clear: Copy your encoded or decoded string with one click.

Formula & How It Works

Base64 maps groups of 24 bits (3 bytes) into 4 six-bit digits drawn from a 64-character alphabet:

Alphabet:
A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63)
Padding: = (used when input length is not a multiple of 3)

Encoding Formula:
1. Group every 3 bytes (3 * 8 = 24 bits).
2. Split into 4 chunks of 6 bits each.
3. Map each 6-bit index (0 to 63) to the Base64 alphabet.
4. If 1 byte remains, pad with '=='. If 2 bytes remain, pad with '='.

Worked Example: Input string "Man". ASCII codes: 77, 97, 110. Binary: 01001101 01100001 01101110. Regroup into four 6-bit chunks: 010011 (19='T'), 010110 (22='W'), 000101 (5='F'), 101110 (46='u'). Base64: TWFu.

Practical Worked Examples

Plain Text InputBase64 Encoded OutputPadding Note
"ToolsLand"VG9vbHNMYW5kNo padding needed (9 bytes = multiple of 3)
"Hello World"SGVsbG8gV29ybGQ=Single '=' padding (11 bytes)
"admin:secret"YWRtaW46c2VjcmV0HTTP Basic Auth format

Common Everyday & Professional Use Cases

Constructing HTTP Basic Authentication headers, generating data URIs for embedding small images directly into CSS, decoding JWT token headers and payloads, and safely transmitting binary hashes via email.

Frequently Asked Questions about Base64 Encode / Decode

No! Base64 is a reversible encoding method designed for transport compatibility, not security. Anyone can decode a Base64 string in a fraction of a millisecond without a key.
Base64 requires data to be processed in 3-byte blocks. If an input string has 1 or 2 leftover bytes at the end, '=' characters are appended as padding to complete the 4-character output block.
Yes. Because 3 bytes of raw data are expanded into 4 characters of ASCII text, Base64 encoding increases data overhead by approximately 33%.
Yes. Our implementation properly decodes UTF-8 byte streams, safely encoding characters like '€' or '🚀' without throwing standard browser btoa errors.
Never. All encoding and decoding operations run strictly within your local browser memory sandbox.
Explore More

Related Free Online Tools

All Developer, Web & Image Tools →

JSON Formatter & Validator

Format, beautify, minify, and validate JSON data structures with clear syntax error indicators.

URL Encode / Decode

Percent-encode special characters for safe URL transmission and decode encoded URI query strings.

Hash Generator

Generate cryptographic hashes including MD5, SHA-1, SHA-256, and SHA-512 simultaneously from any text input.

Password Generator

Generate strong, cryptographically secure, randomized passwords with customizable length and symbol rules 100% client-side.

Helpful Guides & Mathematical Tutorials