Base64 Encode/Decode

Encode text to Base64 or decode Base64 to text.

Input
Output

                        

About Base64 Encode/Decode

Base64 encoding converts binary data to ASCII text. Use this tool to encode or decode Base64 strings.

Common Use Cases:

  • Encoding data for URLs
  • Encoding images for data URIs
  • Decoding Base64 encoded data
  • Data transmission encoding

Developers: see the CI/CD & pipeline guide. More tutorials: guides hub · by Nalla.

Base64 encoding, binary data as safe text

Base64 is a binary-to-text encoding that represents any sequence of bytes as a string of 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /, with = used as padding. It was designed to carry binary data (images, files, arbitrary bytes) through systems that only handle text, email protocols (SMTP), HTTP headers, JSON payloads, XML attributes, and many data interchange formats. Every 3 bytes of input become 4 characters of output, making Base64 output roughly 33% larger than the original.

Common uses: embedding images in HTML and CSS as data URIs (src="data:image/png;base64."), encoding binary files for JSON API transmission, storing binary credentials in environment variables, and Basic Authentication in HTTP headers (Authorization: Basic dXNlcjpwYXNz is the Base64-encoded user:pass). The URL-safe variant replaces + with - and / with _ to make Base64 strings safe in URLs without percent-encoding.

VariantCharacters usedTypical use
Standard Base64A–Z a–z 0–9 + /Email (MIME), data URIs, general encoding
URL-safe Base64A–Z a–z 0–9 - _JWT tokens, OAuth, URL parameters
MIME (line-wrapped)Standard + CRLF every 76 charsEmail attachments

Decoding to inspect encoded payloads

Paste any Base64 string here and click Decode to see the underlying text. This is useful for inspecting JWT payload sections (the middle segment of a JWT token, between the two dots, is Base64url-encoded JSON), HTTP Basic Auth headers, encoded configuration values, and data URIs. Remember that Base64 is encoding, not encryption, any decoded string is readable in plain text. Never treat Base64 as a security measure for sensitive data without actual encryption layered on top.

Related: URL encoder for percent-encoding, JSON formatter for decoded JWT payloads.

Frequently Asked Questions

Base64 was created to safely transmit binary data (like images, audio files, or arbitrary bytes) through systems designed to handle only printable ASCII text. Early email systems (SMTP) and many data interchange formats could not handle raw binary data, they would corrupt it. Base64 encodes any data as a string of 64 printable characters (A–Z, a–z, 0–9, +, /) that pass through text-only systems safely.

No. Base64 is encoding, not encryption. Anyone who sees a Base64 string can decode it instantly using any Base64 decoder. It provides no confidentiality, do not use it to "hide" passwords or sensitive data. It is purely a way to represent binary data as text. HTTP Basic Authentication uses Base64 to transmit credentials, but this is why HTTPS (encryption) must be used alongside it.

Base64 encoding makes data approximately 33% larger than the original. Three bytes of input become four Base64 characters. A 1 MB image encoded as Base64 becomes roughly 1.33 MB. This overhead is why Base64 is used only when necessary (e.g., embedding images in HTML/CSS data URIs) and not as a general-purpose storage format.