Skip to main content

Base64 Encoder

Turn text or encoded bytes into Base64. Pick the input encoding and the alphabet your target system expects.

Rated 4.8 out of 5 based on 1204 reviews

Input
Output

How to encode Base64

  1. Paste text, or paste hex / Base64 if the data is already encoded.
  2. Set Input encoding. UTF-8 is correct for normal text.
  3. Choose a format. MIME wraps lines; URL-safe uses - and _; IMAP uses a comma in place of /.
  4. Copy the output, or decode it later with the Base64 decoder.

Base64

Binary-to-text encoding (RFC 4648 and related profiles)

RFC 4648A-Z, a-z, 0-9, +, / with = padding
URL-safe- and _ in place of + and /
MIME (RFC 2045)Same alphabet, wrapped at 76 characters
UTF-7 and IMAPRFC 2152 and RFC 3501. These drop padding and change two alphabet characters
Not encryptionAnyone can decode the output

What Base64 is

Base64 represents bytes as ASCII so they can travel through systems that expect text (email, JSON strings, data URLs). It expands size by about 33%. It is an encoding, not a cipher.

Need the original bytes back? Use the Base64 decoder. For query strings, use URL encoding instead. More converters are in encoding tools.

Formats this page supports

Input encoding converts the paste into bytes, then those bytes are written with the selected alphabet. RFC 4648 is the usual form. URL-safe is for tokens in URLs. MIME inserts a line break every 76 characters. UTF-7 and IMAP drop padding and change two of the alphabet characters. A custom alphabet must be 64 unique characters.

Base64 questions

Is Base64 encryption?
No. Anyone can decode the result.
Why do I see = at the end?
Padding aligns RFC 4648 output to a multiple of four characters. UTF-7 and IMAP formats omit padding.
When do I use Hex as input encoding?
When the paste is already a hex dump of bytes, not Unicode text. The encoder then Base64-encodes those bytes, not the hex characters as UTF-8.