Base64 encoder and decoder

Convert text to Base64 and back. Handles Unicode correctly (emoji, accents, non-Latin scripts), supports the URL-safe alphabet used in JWTs, and strips data-URL prefixes automatically when decoding. Output updates as you type.

✓ Runs in your browser — nothing uploaded Free, no sign-upNo watermark

How to use the Base64 Encode / Decode

  1. Choose Encode or Decode.
  2. Paste your text or Base64 string.
  3. Tick URL-safe for JWT/URL contexts.
  4. Copy the result.

What Base64 is for

Base64 represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /), so it can travel through systems that only handle text: email bodies, JSON fields, HTML data URLs, HTTP basic-auth headers, JWT tokens. It is an encoding, not encryption; anyone can decode it, so never use it to hide secrets.

Size overhead

Every 3 bytes become 4 characters, so Base64 output is about 33% larger than the input. Padding with = at the end makes the length a multiple of four; the URL-safe variant drops the padding and replaces +// with -/_ so the string can sit in a URL without escaping.

Unicode handled properly

Naive JavaScript btoa() fails on characters outside Latin-1. This tool encodes text as UTF-8 bytes first, so "café", "こんにちは" and emoji round-trip correctly. When decoding, the bytes are interpreted as UTF-8; if the input was binary (an image, for example) you will see garbled text, which is expected.

Data URLs

Pasting a full data URL such as data:image/png;base64,iVBOR… into the decoder strips the prefix automatically. To convert a file to a data URL, use the file-to-Base64 tool (coming soon) rather than pasting binary here.

Frequently asked questions

Is Base64 encryption?

No. It is a reversible text encoding; anyone can decode it instantly. Use real encryption for secrets.

Why is my decoded output garbled?

The Base64 probably encodes binary data (an image, a file) rather than UTF-8 text.

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

URL-safe uses - and _ instead of + and /, and usually omits the = padding, so it can be placed in URLs and JWTs without escaping.

Is the text sent to a server?

No. Encoding and decoding run in your browser.

Privacy

This tool runs entirely inside your browser using WebAssembly and the Canvas/File APIs. Your files are never uploaded to ToolFlint or any third party; you can verify this in your browser's network tab or by switching to airplane mode after the page loads. Read how we process files.

Last updated 2026-09-23.