Base64 Encode
Encode text or binary to Base64 online using UTF-8, UTF-16, Hex, custom alphabets, Base64URL, MIME, UTF-7, and IMAP variants. Read more
What is Base64 encoding?
Base64 converts binary data into text using a 64-character alphabet. It represents each group of three input bytes as four encoded characters, making binary data easier to carry through text-oriented formats. Base64 increases the data size and does not provide encryption, secrecy, or integrity protection.
The standard and URL-safe alphabets are defined in RFC 4648.
How to encode data as Base64
Enter text or encoded binary data, select the input encoding, choose a Base64 format, and select Encode. For normal text, UTF-8 is usually the correct input encoding. Hex and other encodings interpret the entered value as bytes rather than literal text.
For example, UTF-8 text Hello produces:
SGVsbG8=
Text that looks identical can produce a different result under another character encoding because Base64 operates on bytes, not characters.
Which Base64 format should I choose?
- RFC 4648 is the common standard Base64 alphabet using
+and/. - RFC 4648 URL Safe replaces
+and/with-and_for use in URLs and filenames. - RFC 2045 (MIME) supports line wrapping used in MIME content.
- RFC 2152 (UTF-7) and RFC 3501 (IMAP) are specialized variants for compatibility with those formats.
- Custom lets you supply the exact 64-character alphabet required by another implementation.
Use the variant required by the receiving system. Different alphabets and line-break rules can produce different encoded text for the same bytes.
Base64 padding and line breaks
Standard Base64 uses = padding when the input length is not a multiple of three bytes. Some URL-safe applications omit padding, but you should follow the requirements of the target format rather than removing it automatically.
MIME output may insert CRLF or LF line breaks. Those breaks are formatting around the encoded data and must be handled consistently by the decoder.
Base64 FAQ
Is Base64 encryption?
No. Anyone can decode Base64 without a key. Do not use it to protect passwords, tokens, or private data.
Why is the Base64 output different from another tool?
Compare the input character encoding, Base64 alphabet, padding, and line-break settings. Also check for invisible whitespace or different line endings in the source.
How do I decode the result?
Use the Base64 Decode tool. Select a compatible format and output encoding so the decoded bytes are interpreted correctly.