Base64 Encode / Decode

Encode text to Base64 or decode Base64 back to text – UTF-8 safe.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

Base64 Encode and Decode Online

This free Base64 encoder and decoder converts plain text to Base64 and Base64 back to readable text instantly, right in your browser. Paste your data, pick Encode or Decode, and the result updates while you type. Nothing is uploaded to a server, so it's safe to use with configuration files, tokens, and other private data.

How Base64 works

Base64 splits the input into groups of 3 bytes (24 bits) and maps every 6 bits to one of 64 printable characters: A–Z, a–z, 0–9, + and /. When the input length isn't a multiple of three, the output is padded with one or two = characters. The text is converted to UTF-8 bytes first, so accented letters, Turkish characters, Chinese text, and emoji are encoded correctly — something the browser's built-in btoa() function can't do on its own.

Options

  • URL-safe – use the Base64URL alphabet (- and _) for URLs, cookies, and JSON Web Tokens.
  • Padding – keep or drop the trailing = characters.
  • Line wrap – break the output every 76 characters (MIME / email) or 64 characters (PEM certificates and keys).
  • Decode as – read the decoded bytes as UTF-8 or Latin-1.

The decoder is forgiving: it ignores spaces and line breaks, accepts missing padding, understands both the standard and URL-safe alphabets, and strips a data:...;base64, prefix automatically. If the input contains an invalid character, you'll see its exact position.

Common uses

Developers use Base64 to embed small files in HTML and CSS, send binary attachments in email (MIME), store binary values in JSON or XML, pass data in URLs, read HTTP Basic Authentication headers, and inspect the header and payload of JWT tokens. For specific formats, try JSON to Base64, Image to Base64, or Base32 Encode / Decode.

Frequently Asked Questions

No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string without a key, so never use it to hide passwords or secrets. Use it only to move binary or special-character data through systems that expect plain text.

Base64 represents every 3 bytes with 4 characters, so the encoded result is about 33% larger than the original. Line wrapping adds a few more bytes for the line breaks.

URL-safe Base64 (RFC 4648 §5, also called Base64URL) replaces + with - and / with _ so the string can be used in URLs, file names, and JWT tokens without extra escaping. Padding (=) is often removed as well. The decoder on this page accepts both alphabets automatically.

The Base64 string probably contains binary data such as an image, a ZIP file, or text in a legacy encoding. Try the Latin-1 option, or use Base64 to Image to preview and download binary data.