Skip to content
DoItJag

Base64 Encode and Decode

Convert text to Base64 and back. Handles any language and emoji (UTF-8), URL-safe Base64, and missing padding.

About Base64 Encode and Decode

Base64 turns any sequence of bytes into plain letters, digits and a few symbols, so the data can travel through systems that only handle text. You meet it in email attachments, data: URLs, HTTP Basic authentication headers, JSON Web Tokens and many configuration files. This tool converts text to Base64 and back, and tells you when a Base64 string actually holds a binary file rather than text.

It is handy for developers debugging headers or tokens, and for anyone who has found an unreadable block of characters ending in = and wants to know what it says.

When to use it

  • You need to read the payload section of a token or a value stored in a Kubernetes secret.
  • You are building a Basic authentication header by hand for a quick test.
  • A Base64 value in a log turned out to be an image or PDF, and you want the file back.
  • You need an identifier that is safe to use in a URL or file name.

Worked example

Encode the text Café ☕. Text is first turned into UTF-8 bytes (9 bytes here, because é takes 2 and the coffee cup takes 3), and the result is:

Q2Fmw6kg4piV

Paste Q2Fmw6kg4piV into Decode and you get Café ☕ back.

The URL-safe option only changes output that contains +, / or padding. For example, a?b>c encodes to YT9iPmM= normally and to YT9iPmM with URL-safe ticked.

Good to know

  • URL-safe output uses - and _ instead of + and / and drops the = padding.
  • The decoder accepts both standard and URL-safe input, ignores spaces and line breaks, and does not need the padding.
  • Input with characters outside the Base64 alphabet, or with an impossible length, is rejected with an explanation.
  • If the decoded bytes are not valid UTF-8, the tool shows the size and the first 32 bytes in hex, and offers decoded.bin for download.
  • Base64 makes data about a third larger and hides nothing. To fingerprint data, use the hash generator.

How to use Base64 Encode and Decode

  1. Choose Encode or Decode.
  2. Paste your text or Base64.
  3. Copy the result.

Privacy: how it works

Everything happens in your browser. Your text is not sent to any server.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse. Never use it to hide passwords or secrets.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / and drops the = padding, so the result can be used in URLs and file names.

What if the Base64 contains a file, not text?

The tool detects binary data and lets you download it as a file instead of showing garbled text.