One Click Answers

OCADeveloper & Design

Share tool
FacebookPinterestEmail

Base64 Encoder & Decoder

Turn text into Base64, or Base64 back into text. Type and the answer appears.

About this tool & how to use it

What the Base64 Encoder / Decoder does

Turns text into Base64, or turns Base64 back into readable text. Base64 is a way of writing data using only ordinary letters and numbers so it can travel safely inside text.

How to use the Base64 Encoder / Decoder

  1. Choose Encode or Decode.
  2. Paste your text or Base64 into the input.
  3. Copy the result, or press Swap to send it back through the other direction.
Base64
 

Related tools

Try another answer

Lines of colorful program code on a computer screen
Photo: Markus Spiske (CC0, via Wikimedia Commons)

How it works

Text is first converted to UTF-8 bytes, then those bytes are written using the 64-character alphabet from RFC 4648. That is why accents and emoji survive a round trip.

The URL-safe option swaps + and / for - and _ and drops the = padding, as used in JWTs and URLs.

When decoding, spaces and line breaks are ignored, and both the standard and URL-safe alphabets are accepted.

Base64 is an encoding, not encryption. Anyone can decode it, so never use it to protect secrets.

More examples: "Man" encodes to TWFu, and "Hi" encodes to SGk= (one = of padding). The bytes FB FF encode to +/8= in the standard alphabet and -_8 in the URL-safe one, which drops the padding.

Assumptions

  • Text is encoded as UTF-8 before Base64 (RFC 4648).
  • Decoding ignores whitespace and accepts both the standard and URL-safe alphabets, with or without padding.
  • Decoded output must be valid UTF-8 text; binary data such as images cannot be shown as text.

Base64 Encoder / Decoder example

Input: Hello, World!

Result: SGVsbG8sIFdvcmxkIQ==

Base64 Encoder / Decoder questions

Why does decoding say the bytes are not valid text?

The Base64 was valid, but what it encodes is binary data such as an image or file, not UTF-8 text.

Is Base64 a form of encryption?

No. It only changes how bytes are written, and anyone can reverse it. Never use Base64 to hide a password or secret.

Why is the Base64 version longer than the original?

Every 3 bytes of input become 4 characters of output, so Base64 is about one third larger. "Hello, World!" is 13 characters and becomes 20.

What do the = signs at the end mean?

They are padding that fills the last group of 4 characters. The URL-safe option drops them because they are awkward in URLs.

Is my input uploaded?

No. Encoding and decoding happen in your browser and the text is never sent anywhere.

What is the = at the end?

Padding. Base64 writes bytes in groups of three, and = fills the last group. The URL-safe option leaves it off.

When should I use the URL-safe option?

When the result goes into a URL or a token such as a JWT, where + and / are awkward. It swaps them for - and _ and drops the padding.

Last reviewed 2026-10-19. Report an incorrect result

Got another question?

Free, no account. Answers show how they were worked out.