This Base64 encoder and decoder turns text into Base64 and back again, with an option for the URL-safe variant. It handles accented letters, currency symbols and emoji correctly because it converts text to UTF-8 bytes first. All conversion happens in your browser, so nothing you paste is sent to a server.

How to use the Base64 encoder

  1. Type or paste your text into the Input box.
  2. Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
  3. Tick URL-safe if the result will go into a URL, a filename or a JSON Web Token. It swaps + and / for - and _ and drops the = padding.
  4. The result updates as you type. Click Copy to copy it.
  5. Click Swap to move the output into the input and flip the mode, which is a quick way to check a round trip.

When decoding, the tool accepts both standard and URL-safe input, ignores spaces and line breaks, and adds missing padding for you. If the input contains characters that are not part of Base64, you will see an error instead of a result.

How it works

Base64 represents binary data using 64 printable characters: A–Z, a–z, 0–9, plus two extra symbols. Every 3 bytes of input (24 bits) are split into four 6-bit groups, and each group maps to one character. When the input length is not a multiple of 3, the output is padded with one or two = signs. That is why Base64 output is always about 33 percent larger than the original.

Text has to become bytes before it can be encoded. This tool uses UTF-8, the encoding used by almost every website and API. A plain letter takes one byte, while a symbol like € takes three. When decoding, the bytes are checked for valid UTF-8; if they are not text (for example, a Base64 image), the tool tells you rather than showing garbled characters.

Example

Encoding the short text Café ✓ gives:

Q2Fmw6kg4pyT

The input has 6 characters but 9 bytes in UTF-8 (é is 2 bytes, ✓ is 3), so the output is 12 characters with no padding. Here is a case where the URL-safe option matters. The text ?>? encodes to:

Standard:  Pz4/
URL-safe:  Pz4_

The standard version contains a slash, which would break a URL path. The URL-safe version replaces it with an underscore.

Common uses for Base64

Where you see it Why Base64 is used
HTTP Basic authentication The header carries user:password encoded as Base64.
Data URLs Small images are embedded in CSS or HTML as data:image/png;base64,….
Email attachments MIME encodes binary files so they survive text-only mail systems.
JSON Web Tokens The header and payload are URL-safe Base64 without padding.
API payloads Binary data such as files or keys is sent inside JSON strings.

If you are inspecting a decoded JSON payload, paste it into our JSON formatter to make it readable.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it without a key, so never use it to hide passwords or secrets.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and / and pads with =. URL-safe Base64 uses – and _ instead and usually leaves out the padding, so the result can sit in a URL or filename without escaping.

Why does my decoded text look wrong in other tools?

Many older tools decode bytes as Latin-1 rather than UTF-8, which garbles accented letters and emoji. This tool always uses UTF-8 in both directions.

Why do I get an “invalid Base64” error?

The input contains a character outside the Base64 alphabet, or its length cannot be valid. Check for stray quotes, a missing character, or text copied from around the encoded value.

Is my data uploaded anywhere?

No. Encoding and decoding run in your browser. You can disconnect from the internet after the page loads and the tool still works.