Home/Base64 Codec

Base64 Codec

Encode and decode Base64, URL-safe Base64, and Hex — all in your browser using native Web APIs.

Plain Text Input
0 bytes
Base64 Output
0 chars
Format:
Quick examples:
Advertisement

Understanding Base64 Encoding

Base64 Encoding Process (3 bytes → 4 chars)

byte 1byte 2byte 301001101011000010110111024 bits = "Man"split6 bits6 bits6 bits6 bits6 bitsTWFuBase64("Man") = "TWFu"

Base64 is a binary-to-text encoding scheme (defined in RFC 4648) that represents binary data using 64 printable ASCII characters. It groups every 3 bytes (24 bits) of input into 4 groups of 6 bits each, then maps each 6-bit value to a character in the Base64 alphabet (A-Z, a-z, 0-9, +, /).

Base64 Variants

VariantChars 62–63PaddingUse Case
Standard (RFC 4648)+ /= paddingMIME, email, file encoding
URL-Safe (RFC 4648 §5)- _OptionalJWTs, URLs, filenames
Base64url (no padding)- _NoneOAuth 2.0, PKCE, OpenID
MIME (RFC 2045)+ /76-char linesEmail attachments

Common Use Cases

  • HTTP Basic Auth: Authorization: Basic base64(user:password)
  • JWT Tokens: Each section (header/payload/signature) is Base64URL encoded.
  • Data URLs: data:image/png;base64,iVBOR... embeds images in HTML/CSS.
  • Email Attachments: MIME encoding transfers binary files over text-based SMTP.
  • API Payloads: Encode binary blobs (images, PDFs) in JSON strings.

Frequently Asked Questions

What is Base64 encoding used for?

Base64 converts binary data into ASCII text so it can be safely embedded in places that only support text, such as JSON payloads, email attachments (MIME), data URIs in CSS/HTML, and configuration files.

Is Base64 the same as encryption?

No. Base64 is an encoding scheme, not encryption — it provides no security or confidentiality. Anyone can decode a Base64 string instantly, so it should never be used to protect sensitive data like passwords.

Why does my decoded output look garbled?

This usually means the input wasn't valid Base64 (wrong padding, invalid characters) or the original data wasn't UTF-8 text — for example, decoding a Base64-encoded image will produce binary data, not readable text.

Does this tool send my data anywhere?

No — encoding and decoding both happen entirely in your browser using standard JavaScript APIs (btoa/atob), so nothing you type is ever transmitted to a server.