~ / developer / base64

⇄ Base64 Encode / Decode

Convert text to Base64 and back. UTF-8 safe for accents, emoji and non-Latin scripts — and nothing leaves your browser.

plain.txt
encoded.b64
ready.

How to use

  1. Type or paste text into plain.txt on the left and click Encode →. The Base64 string appears in encoded.b64 on the right.
  2. To decode Base64, paste it on the right and click ← Decode. The original text is restored on the left.
  3. Tick URL-safe before encoding to get output you can drop straight into a URL, cookie or filename.
  4. Swap exchanges the two boxes. Copy output copies whichever box was filled last.

What is Base64?

Base64 represents binary data using only 64 characters: A–Z, a–z, 0–9, + and /. It's how bytes travel through channels that only accept text — email attachments (MIME), data: URLs for images, HTTP Basic Auth headers, JSON fields that carry files, PEM certificates and JWTs.

The trick is simple: take 3 bytes (24 bits), split them into four 6-bit chunks, and map each chunk (0–63) to one character. That's why Base64 output is about 33% larger than the input. When the last group has fewer than 3 bytes, = padding is added so the length is a multiple of 4.

TextBytesBase64
Man3TWFu
Ma2TWE=
M1TQ==
user:pass9dXNlcjpwYXNz (an HTTP Basic Auth header)
café5 (é is 2 bytes)Y2Fmw6k=

Why accents and emoji don't break

The browser's native btoa() throws an error on anything outside Latin-1, which is why many quick snippets fail on "é" or "👋". This tool first converts your text to UTF-8 bytes and then Base64-encodes those bytes — the same thing Python's base64.b64encode(s.encode()) or Node's Buffer.from(s).toString('base64') does. Decoding is strict UTF-8 too: if the decoded bytes aren't valid UTF-8 text, you'll see an error instead of garbled characters.

Standard vs. URL-safe Base64

Variant62nd char63rd charPadding
Standard Base64 (RFC 4648 §4)+/= added
URL-safe / Base64URL (RFC 4648 §5)-_usually omitted

Decoding accepts both variants whether or not the checkbox is ticked: - and _ are converted back, missing = padding is restored, and spaces or line breaks in the middle are ignored — handy for line-wrapped MIME or PEM data.

Base64 is not encryption. Anyone can decode it instantly, so never use it to "hide" passwords or personal data. This tool is text-only: decoding an image or PDF will show a UTF-8 error. Everything runs in your browser and nothing is uploaded.

FAQ

How do I decode a Base64 string?
Paste it into the right-hand box and click ← Decode. The text appears on the left. Standard and URL-safe Base64 are both accepted, with or without = padding.
What does the == at the end mean?
It is padding. Base64 works in groups of 3 bytes; if the input length is not a multiple of 3, one = (2 bytes left over) or two == (1 byte left over) are added so the output length is a multiple of 4.
How much bigger does Base64 make my data?
Every 3 bytes become 4 characters, so output is about 4/3 the size of the input — roughly 33% larger, plus a little more for padding and line breaks.
Is Base64 encryption?
No. It is a reversible encoding with no key. Anyone can decode it in a second. Use real encryption (AES, for example) or hashing (bcrypt, Argon2) for secrets.
Why does my decoded text look garbled?
The original was probably encoded from a legacy character set such as Windows-1252 or Shift-JIS rather than UTF-8, or it is binary data like an image. This tool only decodes UTF-8 text and shows an error otherwise.
Can I use this to read a JWT?
Each JWT segment is URL-safe Base64, so you can decode one segment at a time. The JWT Decoder is easier: it splits the token, pretty-prints header and payload, and explains exp/iat times.

Related tools