Base64 Encoder & Decoder

Encode text to Base64 or decode it back, with URL-safe and file support.

Options

Examples

How Base64 works

Base64 writes any bytes using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes of input become 4 characters, so the output is about 33% larger. = pads the end when the input length isn’t a multiple of 3.

Text encoding

Base64 encodes bytes, so text has to become bytes first. This tool uses UTF-8. The same character can give different Base64 under a different encoding:

Input Encoding Base64
é UTF-8 (this tool) w6k=
é Latin-1 6Q==

Both are correct. They encode different bytes. If your output doesn’t match another tool’s, check which encoding it used.

Common jobs

Questions

What happens when the Base64 is an image or a file?

The tool recognises common files by their first bytes: PNG, JPEG, GIF, WebP, PDF, ZIP and more. It previews images, lets you download the file, and shows the raw bytes as a hex dump. A data: URI prefix is removed for you.

Is Base64 encryption?

No. Anyone can decode Base64 without a key. It exists to move binary data through text-only channels. Never use it to hide passwords or tokens.

Why does my emoji or accented text encode differently elsewhere?

Base64 encodes bytes, not characters, so the result depends on how the text was turned into bytes first. This tool uses UTF-8, like browsers, JSON and most APIs. A tool that uses UTF-16 or Latin-1 gives different output.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant (RFC 4648 §5) uses - and _ instead and usually drops the = padding. JWTs use it.

Does my input get uploaded?

No. Encoding and decoding run in your browser.