Base64 Encode / Decode

Encode text or files to Base64 and decode Base64 strings back — entirely in your browser.

Base64 Converter

Switch between Encode and Decode modes. Supports plain text, Unicode, and file input including images — with an inline image preview for Base64 image strings.

Text to Encode

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /, with = used for padding. It is used to safely transmit binary data — such as images, files, or cryptographic keys — through text-based channels like email (MIME), JSON APIs, HTML data URIs, and HTTP headers that may not handle raw binary safely.

How to Use the Base64 Encoder / Decoder

  1. Encode text: Select Encode mode and Text input, type or paste your text, and click Encode.
  2. Encode a file: Select Encode mode and File input, then drag and drop or browse for any file. The output includes both the raw Base64 and a ready-to-use Data URI for images.
  3. Decode: Switch to Decode mode, paste a Base64 string, and click Decode. If the decoded output is an image data URI, a live image preview appears automatically.
  4. Enable URL-safe Base64 to replace + with - and / with _ for use in URLs and filenames.
  5. Enable Add line breaks to wrap the output at 76 characters per line (MIME standard).
  6. Use Use as Input to swap the output back to the input and switch modes for round-trip testing.

Key Features

Common Use Cases

URL-Safe Base64 (base64url)

Standard Base64 uses + and / characters which have special meaning in URLs. URL-safe Base64 (defined in RFC 4648) replaces + with - and / with _, and typically omits the = padding. This variant is used in JWT tokens, OAuth 2.0, and any context where the Base64 string appears in a URL query parameter or filename.