Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 back to plain text in real-time.

runs locally on your browser. Your data never leaves your device.
Input
Output

How it works: Type in either panel to convert in real-time. Base64 encoding represents binary data as printable ASCII characters and is commonly used in data transfer, emails, and web development.

Common Use Cases

Decode a JWT payload to inspect its claims without a separate JWT tool
Encode Basic Auth credentials (username:password) for an HTTP header
Check whether a string is valid Base64 before passing it to an API
Inspect a data URI embedded in HTML or CSS source code

About Base64 Encoder/Decoder

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It was designed to safely transport binary data over channels that only handle text, primarily email (via MIME) and HTTP headers. Today Base64 appears in dozens of everyday contexts: it's how images are embedded directly in HTML and CSS as data URIs, how Basic Auth credentials are formatted in HTTP headers, how SSH public keys and TLS certificates are stored in PEM files, how JWTs encode their header and payload, and how binary attachments are transmitted in email.

The encoding works by taking 3 bytes of binary data (24 bits) and breaking them into four 6-bit groups, each mapped to one of the 64 printable characters. This means Base64-encoded data is always approximately 33% larger than the original binary data. The `=` padding characters at the end of a Base64 string ensure the output length is always a multiple of 4.

Common pitfalls: standard Base64 uses `+` and `/` as the 62nd and 63rd characters, but these are not URL-safe (they have special meaning in URLs). URL-safe Base64 (Base64url) replaces them with `-` and `_`. If you're working with JWTs or URL parameters, check which variant you need. Also note that Base64 is encoding, not encryption, since it is trivially reversible and provides zero security.

This tool handles standard Base64 in both directions in real time: type or paste in either panel and the other updates instantly.

Frequently Asked Questions

Is Base64 the same as encryption?
No. Base64 is an encoding scheme, not encryption. Anyone who sees a Base64-encoded string can decode it immediately with any Base64 decoder. It provides no confidentiality. Base64 exists to safely transport binary data as text, not to protect data from being read.
Why does Base64 end with one or two equals signs?
The '=' padding characters are added to ensure the encoded string's length is always a multiple of 4 characters. If the input data length is not a multiple of 3 bytes, 1 or 2 padding characters are appended. Some implementations (like Base64url used in JWTs) omit the padding entirely since it can be inferred from the string length.
What is the difference between standard Base64 and URL-safe Base64?
Standard Base64 uses '+' and '/' as the 62nd and 63rd characters. URL-safe Base64 (Base64url) replaces these with '-' and '_' because '+' and '/' have special meanings in URLs. JWT tokens use Base64url (without padding). If you're decoding a JWT payload, ensure you're using a URL-safe decoder.
Can I encode images or binary files with this tool?
This tool encodes and decodes text (string data), not binary files. If you need to encode a binary file such as an image, you would first need to load the file as binary data in a programming environment. For embedding images in HTML/CSS as data URIs, use a file-to-Base64 converter that handles binary input.
Why can't my text be encoded?
Standard Base64 (via the browser's btoa() function) only handles characters in the Latin-1 character set. If your text contains characters outside this range (emojis, Chinese characters, Arabic script, etc.), encoding will fail. For arbitrary Unicode text, you need UTF-8 Base64 encoding, which first converts the string to UTF-8 bytes before encoding.