Skip to main content

Base64 Encode / Decode

Base64 turns arbitrary bytes into plain ASCII text that can travel safely through systems built for text. This converter works in both directions and is UTF-8 safe — “héllo ☕”, emoji, Arabic, or Chinese text all encode and decode exactly, where naive converters corrupt them.

Everything runs in your browser; the strings you convert are never uploaded.

Direction

Encoding works on the text’s UTF-8 bytes, so accents and emoji survive the round trip. Everything runs in your browser.

Embed this calculator on your website →

The formula

every 3 bytes → 4 characters from A–Z a–z 0–9 + / · = pads the final group · size grows by about 1/3

  • UTF-8 first — your text is turned into UTF-8 bytes, then Base64-encoded. Decoding reverses it exactly; bytes that are not valid UTF-8 text are reported honestly instead of being mangled into replacement characters.
  • padding — outputs end with = or == when the byte count is not a multiple of three.
  • strict decode — invalid characters are named in the error message instead of being silently skipped.

Worked examples: “hello” → aGVsbG8=; “héllo” → aMOpbGxv (the é takes two UTF-8 bytes, which is exactly what naive converters get wrong).

How it works

Base64 exists because many systems — email originally, then data URLs, tokens, and embedded assets — can only be trusted with a small, safe alphabet. Encoding regroups your bytes into 6-bit chunks and prints each chunk as one safe character. The price is size: three bytes become four characters, a 33% overhead, forever the trade for safety.

One warning worth repeating: Base64 is not encryption. Anyone who sees a Base64 string can decode it in seconds — as this very page demonstrates. It hides nothing; it only makes bytes transportable.

Examples

  • Text with an accent → “héllo ☕” encodes to aMOpbGxvIOKYlQ== and decodes back to the identical string, coffee emoji included.
  • A check mark → “✓” encodes to 4pyT — three UTF-8 bytes become one full Base64 group with no padding.
  • Debugging a token → paste a Base64 segment from a token or header and read the text it carries — often a JSON payload or a timestamp.

Frequently asked questions

Why does the output end with = signs?

Padding. Base64 works in groups of four characters per three bytes; when the last group is short, = characters fill it so decoders know exactly how many bytes it represents. One = means the group held two bytes, == means one.

What is URL-safe Base64?

A variant that replaces + with − and / with _ so the result can sit inside a URL without escaping, and often drops the padding. This converter uses the standard alphabet; if you are decoding a URL-safe string, swap those two characters back first — or use it as-is if the string contains neither.

Why did decoding fail with an encoding error?

The Base64 itself was valid, but the bytes it carries are not valid UTF-8 text — usually because they are a binary file (an image, a key, compressed data) or a text in another encoding. The converter says so plainly rather than showing corrupted text.

Is anything uploaded?

No. Encoding and decoding run in your browser, so even sensitive strings — headers, tokens — never leave your device.