Start Submit a site

Base64 Encoder and Decoder

Developer Tools

Encode text to Base64 or decode it back, with UTF-8 support and an optional URL-safe alphabet — nothing leaves your browser.

Your inputs

Browse all tools

Whitespace is ignored when decoding, so wrapped Base64 works too.

URL-safe Base64 replaces + with - and / with _, and drops padding.

Result

Result —
  • UTF-8 bytes —
  • Characters —
  • Size ratio vs input —

Change any input and the result updates instantly.

Formula and rules

  • Base64 splits every 3 bytes into four 6-bit groups and maps each group to one character.
  • Each 3 input bytes become 4 output characters, so encoded size is about 133% of the input.
  • UTF-8 text is converted to bytes first, which is why accented letters and emoji take more than one byte.
  • Padding with = fills the last group when the byte count is not a multiple of three.

Worked examples

Hello, world!

Input Hello, world!

Result SGVsbG8sIHdvcmxkIQ==

Emoji needs four bytes

Input 👋

Result 8J+Riw== — one visible character, four UTF-8 bytes.

URL-safe output

Input subjects?_d=1

Result Standard gives c3ViamVjdHM/X2Q9MQ==, URL-safe gives c3ViamVjdHM_X2Q9MQ without padding.

FAQ

Is Base64 encryption?

No. It is a reversible encoding with no key, so anyone can decode it. Use it to move binary data through text channels, never to protect secrets.

Why do some strings end with = or ==?

The equals signs pad the final group when the input length is not divisible by three. URL-safe variants usually drop this padding, and decoders can restore it.

Why do Chinese characters or emoji break naive encoders?

Simple encoders treat each character as one byte. Chinese characters take three UTF-8 bytes and many emoji take four, so the text must be converted to UTF-8 bytes before Base64 is applied.

Disclaimer: Results follow the formula shown on this page and are for reference only. Real-world quantities vary with materials, technique and conditions, so allow a margin before ordering.