Developer Tools

Base64 Encoder & Decoder

Encode and decode Base64 text with full Unicode support, URL-safe output and file-to-Base64 conversion.

Loading tool…

How to use the Base64 Encoder & Decoder

  1. Pick Encode or Decode, then type or paste into the input box. The result updates as you type.
  2. To encode for use in a URL or JWT-style token, tick “URL-safe alphabet”.
  3. Use the Copy and Download buttons to take the result, or “Use result as input” to round-trip it.
  4. For files, use the Files section: choose a file to get its Base64 (optionally as a data URI), or paste Base64 to download the decoded file.

Good to know

  • Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide secrets.
  • Text is converted with the browser's TextEncoder and TextDecoder (UTF-8). Decoding fails with a clear message if the bytes are not valid UTF-8; use “Base64 to file” for binary data.
  • Decoding is strict: it rejects invalid characters, misplaced padding and impossible lengths, and rejects strings that mix the standard (+ /) and URL-safe (- _) alphabets. Whitespace and line breaks are ignored.
  • Encoded output is about 33% larger than the input. Text input is capped at 2,000,000 characters and files at 10 MB.

Examples

Plain text
Hello, World! → SGVsbG8sIFdvcmxkIQ==
Unicode and emoji
Café ☕ → Q2Fmw6kg4piV (the text is encoded as UTF-8 first, so decoding returns the exact characters).
URL-safe and unpadded
Bytes that encode to “a+b/” in standard Base64 become “a-b_” in URL-safe form. Decoding accepts either, with or without trailing “=”.

Frequently asked questions

Why does the standard btoa() fail on emoji?

btoa only accepts characters up to U+00FF. This tool first converts your text to UTF-8 bytes, which can represent every character, and then encodes those bytes.

What is the difference between standard and URL-safe Base64?

URL-safe Base64 replaces + with - and / with _ so the result can sit inside a URL or file name without percent-encoding, and usually drops the = padding.

Are my files uploaded?

No. Files are read into memory in your browser and converted there. Nothing is sent to a server.

Built By Engineers

Need Something Built For Your Business?

aimEncoders designs and builds custom software, websites and internal tools, backed by automated QA.

  • Reply within 1 business day
  • Fixed quote, no surprise invoices
  • You own 100% of the code

Free discovery call • Straight to a developer • Strict NDA available

Base64 Encoder & Decoder – Text and File to Base64 Online | aimEncoders