Skip to content

Base64 Encode and Decode

Turn text into Base64, or read Base64 back as text.

  • Free, no account
  • Nothing uploaded
  • 13 tools
Input
Output
working…in 26 B · 1 linesProcessed in this tab, no request made

Nothing you paste is uploaded. The server sends connect-src 'self', so your browser blocks this page from contacting any other host. Check it yourself

Encode text to Base64 or decode it back, with correct UTF-8 handling and the URL-safe alphabet. Binary results are shown as hex. Runs in your browser tab.

What Base64 is for

Base64 writes arbitrary bytes using 64 printable characters, so binary data can travel through channels built for text: JSON fields, email, data URIs, HTTP Basic auth. It is not encryption and hides nothing. Every 3 bytes become 4 characters, so the result is about a third larger.

Bolt, M6 × 20 mm        text (UTF-8, × is 2 bytes)
Qm9sdCwgTTYgw5cgMjAgbW0=   standard
Qm9sdCwgTTYgw5cgMjAgbW0    URL-safe, padding dropped

UTF-8 and the URL-safe alphabet

Text is converted to UTF-8 bytes before encoding, so accents, symbols and emoji round-trip. (The browser's bare btoa throws on anything outside Latin-1; this tool does not rely on it for text.) The URL-safe variant swaps + and / for - and _ and drops the padding. The decoder accepts either alphabet and ignores line breaks.

If the decoded bytes are not valid UTF-8, they are shown as hex instead of garbled characters. A string with two dots that starts with eyJ is probably a token: open it in the JWT decoder.

Questions

Short answers to what people ask most.

Is Base64 encryption?

No. It is an encoding that anyone can reverse without a key. It makes binary data safe to place in text, and gives no confidentiality at all.

What is the URL-safe variant?

RFC 4648 §5 replaces + with - and / with _ and usually drops the = padding, so the result can go in a URL or file name. JWTs use it. The decoder here accepts both alphabets, with or without padding.

Why do I see hex bytes instead of text after decoding?

The decoded bytes are not valid UTF-8, which usually means the data is binary (an image, a key, compressed data) or text in another charset. Showing hex avoids presenting garbled characters as if they were the content.

How much bigger is Base64 than the original?

About 33%: every 3 bytes become 4 characters, plus up to two padding characters at the end.