HandyHex.Handy tools in every shape.

About the Base64 Encoder / Decoder

The Base64 Encoder / Decoder converts text to Base64 and back. Base64 represents data using only letters, digits, plus and slash, which makes it safe to place in emails, JSON, URLs and configuration files.

It supports UTF-8, so accented letters and many non-Latin characters are handled correctly. Remember that Base64 is not encryption: anyone can decode it, so never use it to hide passwords or private information.

How to use it

  1. Paste text into Input.
  2. Press Encode or Decode.
  3. Copy the result from Output.

Where you will see it

Data URLs for images, HTTP Basic authentication headers and email attachments.

Encoded text is about a third longer than the original.

An error on decode means the input is not valid Base64, often because of missing characters or spaces.

Real-world examples

Reading a token. Decode the middle part of a JWT-style string to see what it holds.

Embedding text in JSON. Encode binary-looking text safely.

Debugging an email or header. Decode a Basic authorization value to see the user name (and be careful with passwords).

Common mistakes

Treating Base64 as encryption. Decoding URL-safe Base64 without swapping the characters - and _ back to + and /. Pasting text with spaces or line breaks inside. Decoding data that is not text, which produces garbage characters.

How it works

Text is first converted to UTF-8 bytes. Every group of three bytes is split into four 6-bit values, each mapped to one of 64 safe characters, with = padding at the end. Decoding reverses the steps and reads the bytes back as UTF-8.

Frequently asked questions

Is Base64 secure?

No, it is only an encoding.

Does it handle images?

Use Image to Base64 for files.

Is the text uploaded?

No.

Related tools

Guides