All Tools

Base64 Encode / Decode

Encode text to Base64 or decode a Base64 string back to plain text — instantly, all in your browser.

Encoded text will appear here...

Tips & Guide

When to encode

Use Base64 when you need to transmit binary data (such as images or files) through a channel that only supports text, such as email (MIME), JSON APIs, or URLs. It converts arbitrary bytes into a safe set of 64 ASCII characters.

When to decode

If you receive a Base64 string from an API or email header and need to read the underlying text or data, paste it into the Decode tab to convert it back to the original form.

Size increase

Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters. For this reason, Base64 is used for compatibility, not compression.

Non-ASCII characters

Standard Base64 uses btoa/atob which only works with Latin-1 characters. If your text contains emoji or Unicode characters, encode it to UTF-8 first. The error message will alert you if your input contains unsupported characters.

Encode any text to Base64 or decode a Base64 string back to plain text. All processing happens instantly in your browser with no data sent to any server.

  • Encode tab: converts plain text to a Base64 string
  • Decode tab: converts a Base64 string back to plain text

How to use the Base64 Encode / Decode

  1. Select the Encode tab to convert text to Base64, or the Decode tab to reverse the process.
  2. Type or paste your text into the input area.
  3. The result appears immediately on the right.
  4. Click the Copy button to copy the result to your clipboard.

Examples

Encode: "Hello, World!"

SGVsbG8sIFdvcmxkIQ==

Encode: "user:password"

dXNlcjpwYXNzd29yZA== (used in HTTP Basic Auth headers)

Decode: "SGVsbG8="

Hello

Decode: "dXNlcjpwYXNzd29yZA=="

user:password

How to calculate manually

How Base64 encoding works

  1. Convert each character to its ASCII byte value
  2. Group the bytes in sets of 3 (24 bits)
  3. Split each 24-bit group into four 6-bit values
  4. Map each 6-bit value to the Base64 alphabet (A-Z, a-z, 0-9, +, /)
  5. Add = padding to make the output length a multiple of 4

"Man" (77, 97, 110) → 01001101 01100001 01101110 → TWFu

Base64 was first defined for MIME (Multipurpose Internet Mail Extensions) in RFC 1341 in 1992, developed to allow email to carry binary attachments safely through text-only mail servers. The name comes from the fact that it uses exactly 64 characters from the ASCII character set. Today it is used in everything from storing images in CSS to encoding JSON Web Tokens (JWTs).

Frequently asked questions

What is Base64?

Base64 is a way to represent binary data with text characters so it can travel through systems designed for text. It increases the size of the data by roughly one third and is commonly seen in email content, data URLs, and API payloads. It is an encoding, not encryption, so the output is not secret.

Why does Base64 output contain equals signs?

Base64 works in groups of three input bytes and four output characters. If the final group is short, equals signs can be used as padding to show how much data is missing from that group. Some URL-safe or unpadded variants omit that padding, so use the variant expected by the receiving system.

Can Base64 protect an access token?

No. Base64 can be decoded by anyone who sees it and offers no confidentiality or access control. It is fine for transporting already-protected or non-sensitive data, but secrets need proper authentication, encryption in transit, safe storage, and limited exposure. Do not paste live credentials into a public converter.

Why does decoding produce unreadable characters?

Base64 may represent arbitrary binary bytes rather than human-readable text, and text may also use a character encoding such as UTF-8. Check that you selected the correct Base64 variant and character encoding before interpreting the output. If the bytes are a file, save or process them as binary instead of forcing them into text.