Tutorial · Base64 Encoder/Decoder · 4 min read

How to Base64 Encode and Decode Text

Encode text to Base64 or decode it back, understand why Base64 is not encryption, why the output is a third larger, and how it differs from URL encoding.

Base64 turns arbitrary bytes into 64 safe ASCII characters so they survive systems built for text: email attachments, JSON fields, HTTP Basic Auth headers, data URLs. It is an encoding, not encryption; anyone can reverse it. Knowing that saves a lot of false confidence.

What you'll learn

  • Encode UTF-8 text, including emoji and accented characters
  • Decode Base64 and Base64url strings
  • Tell Base64 apart from percent-encoding and know which one a situation needs

Step by step

  1. Choose Encode or Decode

    Open the Base64 Encoder / Decoder and pick the mode with the toggle. The output updates as you type.

  2. Paste the text or the Base64

    Encoding accepts any text, including multi-byte characters. Decoding accepts standard and URL-safe alphabets, with or without padding.

    hello world  →  aGVsbG8gd29ybGQ=
    
    héllo 🚀    →  aMOpbGxvIPCfmoA=
  3. Copy the result

    Use Copy Output. For an HTTP Basic Auth header, encode user:password and send it as Authorization: Basic <value>.

Open the tool with this example Runs in your browser. Nothing you paste is uploaded.

Common problems

Not valid Base64 input

The text contains characters outside A–Z, a–z, 0–9, + and / (or - and _ for URL-safe), or its length is not a multiple of four without padding. Whitespace and line breaks inside the string are common culprits.

Decoded text shows odd symbols

The bytes were not UTF-8 text, for example an image or a compressed blob. Base64 carries any bytes; only text decodes to readable characters.

FAQ

Is Base64 secure?

No. It hides nothing. Use real encryption for secrets, and never treat a Base64 token as confidential.

Why is the output longer?

Every three bytes become four characters, so encoded data is about 33 percent larger.

Base64 or URL encoding?

Base64 packs binary data into text. URL encoding escapes unsafe characters inside a URL. A Base64 value placed in a URL often needs URL encoding as well, or the URL-safe alphabet.