Base64 Encode and Decode

This Base64 encoder and decoder converts text to Base64 and back. It handles UTF-8 text, accented letters and emoji correctly, supports the URL-safe alphabet, and runs entirely in your browser, so nothing you paste is uploaded.

What is Base64?

Base64 turns any data into text made from 64 safe characters: A–Z, a–z, 0–9, + and /. It is used to send binary data through systems built for text, such as email attachments, data URLs in web pages, JSON web tokens and API credentials.

How Base64 encoding works

  1. Text is first converted to bytes (UTF-8).
  2. Every 3 bytes (24 bits) are split into four 6-bit groups.
  3. Each group becomes one of the 64 characters.
  4. If the data does not divide evenly, = signs pad the end.

Because 3 bytes become 4 characters, Base64 output is about 33% larger than the input.

Example

The word Man encodes to TWFu, and Hello, world! encodes to SGVsbG8sIHdvcmxkIQ==.

Standard vs URL-safe Base64

The URL-safe version replaces + with – and / with _, and usually drops the = padding, so the result can go in web addresses and file names without further encoding.

Frequently asked questions

Is Base64 encryption?

No. Base64 only changes the format. Anyone can decode it, so never use it to protect passwords or private data.

Why does my decoded text look like gibberish?

The data may be a file, such as an image, rather than text, or it may use a different character encoding. The tool shows non-text data as hexadecimal bytes.

What does the = at the end mean?

It is padding, added when the input length is not a multiple of 3 bytes. One or two = signs are normal.

Is my data sent to a server?

No. The conversion runs in your browser using JavaScript.

Related calculators

Sources

Last reviewed: October 2026. For information only; results are estimates; check important figures with a professional.

Scroll to Top