Skip to content
Browse tools

Base64 text

Encode and decode without the usual UTF-8 damage: accents and emoji come back exactly as they went in. base64url and padding are switches, not guesswork, so a token or filename-safe value is one click away.

Alphabet
standard · base64url
Text
UTF-8 exact
Padding
on · off
Step 1

Input

empty
Direction
Step 2

Base64 out

Options
empty
Nothing to convert yet Type or paste on the left.

Standard or URL-safe?

Standard Base64

A–Z a–z 0–9 + / =

The original alphabet from RFC 4648 §4. Fine in a request body, an email attachment or a config file. Not safe in a URL, because + becomes a space and / looks like a path separator.

base64url

A–Z a–z 0–9 - _

RFC 4648 §5. Swaps the two awkward characters and usually drops the = padding, so the value survives a query string, a filename or a JWT untouched. Decoding here accepts either alphabet automatically.

Worth knowing

It is not encryption

Base64 offers no secrecy at all — decoding takes one click and no key. It exists to move binary safely through text-only channels. A password stored as Base64 is a password stored in plain text.

Always about a third bigger

Every 3 bytes become 4 characters, so expect roughly +33%. Embedding a large image as a Base64 data URI makes the page heavier than linking the file, and it cannot be cached separately.

Why other tools break emoji

JavaScript's btoa is a byte function. Handed a string it throws above U+00FF and silently mis-encodes between U+0080 and U+00FF. This page converts to UTF-8 bytes first, so é and 🎉 survive a round trip.

Padding is often optional

The trailing = pads the output to a multiple of four. Many parsers, including JWT libraries, drop it. Decoders here re-add it automatically, so pasting an unpadded value works.

Wrap at 76 for MIME

Email bodies traditionally break Base64 into 76-character lines. Whitespace is ignored when decoding, so wrapping is safe — but unnecessary anywhere except MIME.

Text in, text out

This tool works on text, not arbitrary binary. If a decode fails with a UTF-8 error the bytes were probably an image or archive rather than characters.