Skip to content

Base64 encode and decode

Encode text or files to Base64 and decode Base64 back, right in your browser. Your data never leaves your device.

Input

Type or paste text, or open a file.

Output

Nothing to show yet

Type text or open a file. Its Base64 appears here.

How to encode or decode Base64

  1. Choose Encode or Decode. The output updates as you type.
  2. To encode, type or paste text, or select Open file for an image, PDF or any other file. With a file open, turn on Data URL to get a data:…;base64,… string.
  3. To decode, paste Base64 or a data URL, or open a .txt file that contains it. Text is shown as text; anything else, such as an image, is offered as a download with its file type detected.
  4. Copy or download the result. Swap moves the output to the input and switches the mode, to check a round trip.

Options

URL-safe
Uses - and _ instead of + and /, without = padding (base64url, RFC 4648 §5), as in JWTs and URLs. Decoding accepts both alphabets, with or without padding.
Wrap at 76
Breaks the output into lines of 76 characters, as MIME email does. Spaces, tabs and line breaks are ignored when decoding.
Data URL
Shown when a file is open: adds the data: prefix with the file’s type, ready for an HTML src or a CSS url(). Data URLs always use the standard alphabet on one line, so URL-safe and Wrap at 76 are turned off.

What Base64 is

Base64 writes any bytes using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so the result is about a third larger than the original, and = pads the end when the length isn’t a multiple of 3. It carries binary data through text-only channels such as email, JSON and URLs. It is not encryption: anyone can decode it.

Text is encoded as UTF-8, so emoji and every script round-trip exactly: “Grüße 👋” becomes R3LDvMOfZSDwn5GL.

Formats and limits

Input
Text (UTF-8), any file for encoding, and Base64 or data URLs for decoding.
Size
Files up to 50 MB. Files, and text over 1 MB, are processed in a background thread, so the page stays responsive; above 5 MB it may be slow.
Detected file types
PDF, JPEG, PNG, WebP, GIF, AVIF, HEIC, BMP, ZIP and gzip, from their first bytes. Other data uses the data URL’s type, or downloads as .txt if it’s text and .bin if not.

Troubleshooting

  • “… isn’t a Base64 character.” The message gives the line and column. Quotes copied with the value, or %2B-style URL encoding, are common causes. Select Go to error to jump there.
  • “… can’t be complete.” One character too many or several missing: the Base64 was probably cut off when it was copied.
  • The output is a download, not text. The decoded bytes are a known file type such as an image, or aren’t valid UTF-8 text, so showing them would only show garbled characters. Download the file instead.

How your data stays private

Everything happens in your browser, on your device. Your files and text are never uploaded, never stored, and never put in the address bar.

  • The site’s security policy (connect-src 'self') tells your browser to block any attempt by the page to send data to another server.
  • Only your preferences, such as the theme and a tool’s last-used options, are saved in your browser’s local storage. Never your content.
  • To check it yourself, open your browser’s developer tools, select the Network tab, and use the tool: no request carries your data.

There is no account, no sign-up and no watermark. After your first visit, pages open without a connection; a tool’s larger parts, such as the PDF and image engines, are saved the first time you use it, so it works offline from then on.

Frequently asked questions

Is my data uploaded when I decode Base64?

No. Encoding and decoding run in your browser, on your device. Nothing you paste or open is uploaded, stored or put in the URL, and the site’s security policy blocks the page from sending data to other servers. That makes it safe for tokens, keys and private files.

How do I decode Base64 to an image or file?

Choose Decode and paste the Base64 or a data URL (data:image/png;base64,…). If the result isn’t text, the tool detects the file type from its first bytes, for example a PNG or a PDF, and offers it as a download with the right extension.

How do I convert an image or file to Base64?

Choose Encode and select Open file. You get the file as Base64, or turn on “Data URL” to get a data:…;base64,… string you can paste into HTML or CSS. Files up to 50 MB are processed in a background thread.

What is URL-safe Base64?

Standard Base64 uses “+” and “/”, which have special meanings in URLs and file names. URL-safe Base64 (base64url, RFC 4648) uses “-” and “_” instead and usually drops the “=” padding. It’s used in JWTs and many web APIs. The decoder accepts both forms automatically.

Why does decoding fail with “isn’t a Base64 character”?

Base64 contains only letters, digits, “+” and “/” (or “-” and “_”), with up to two “=” at the end. The message shows the line and column of the first character that doesn’t belong, often a quote copied with the value, a non-breaking space, or a “%” from URL encoding. Ordinary spaces, tabs and line breaks are ignored.

Is Base64 encryption?

No. Base64 is an encoding: anyone can decode it, without a key. It exists to carry binary data through systems that expect text, such as email, JSON and URLs. Don’t use it to hide passwords or secrets.