Home/ Glossary/ Base64 Encoder / Decoder
Konverter

Base64 Encoder / Decoder

The Base64 Encoder converts any string into its Base64 representation and decodes Base64 strings back to plain text. The tool supports the three most common variants: Standard Base64, Base64url (URL-safe, replacing + and / with - and _), and MIME Base64 with line breaks every 76 characters. It is an indispensable utility for working with APIs, HTTP headers, and data-transfer protocols.

What is Base64?

Base64 is an encoding scheme that converts arbitrary binary data into a set of 64 printable ASCII characters. The 64 characters consist of A–Z, a–z, 0–9, plus + and / (in the standard alphabet); the = character serves as padding. Base64 is not an encryption method – anyone can decode Base64 data without a key. The encoding increases data size by approximately 33% but allows binary data to be safely transmitted over channels that only support text, such as email or JSON payloads.

How does the tool work?

The tool reads the input text as a UTF-8-encoded byte stream. Every three bytes are converted into four Base64 characters: the 24 bits are split into four groups of 6 bits, and each group is mapped to a character in the Base64 alphabet. Missing bytes at the end are filled with padding characters (=). In Base64url mode, + is replaced by - and / by _, making the encoded string safe to use directly in URLs and file names. In MIME mode, CRLF line breaks are inserted every 76 characters, as required by email standards.

Typical Use Cases

  • Embedding images or fonts directly in HTML/CSS as data URIs
  • Encoding credentials for HTTP Basic Authentication headers
  • Transmitting binary data in JSON APIs or email attachments (MIME)
  • Decoding Base64 values in JWT tokens or API responses for inspection

Step-by-step Guide

  1. Step 1: Enter the text to encode or paste a Base64 string to decode into the input field.
  2. Step 2: Select the desired format: Standard, Base64url, or MIME.
  3. Step 3: The tool converts the input instantly and displays the result.
  4. Step 4: Copy the result to your clipboard using the copy button.

Example

Input
Hello, World!
Output
SGVsbG8sIFdvcmxkIQ==

Tips & Notes

  • Use Base64url instead of Standard Base64 when the encoded string will appear in a URL or as a filename.
  • Base64 is not encryption – encoded data can be decoded by anyone instantly. Encrypt separately if security is required.
  • The padding character = at the end can be omitted in some systems; check whether your target system requires it.

Frequently Asked Questions

Why is the Base64 output longer than the input?
Base64 encodes every 3 bytes as 4 characters, resulting in a 33% overhead. Padding with = characters at the end brings the output length to a multiple of 4.
Can I encode binary files with this tool?
This encoder is optimized for text input. To encode files or images, use the Base64 File Converter (base64-file), which supports direct file uploads.
What is the difference between Standard Base64 and Base64url?
Standard Base64 uses + and /, which have special meanings in URLs and would need percent-encoding. Base64url replaces them with - and _, making the string URL-safe and usable in URLs without further encoding.
Base64 Encoder / Decoder
Easily encode and decode strings to and from their Base64 representation. Supports Standard, Base64url, and MIME format.
Open Tool