Home / Developer & Data / Base64 Encoder and Decoder
💻

Base64 Encoder and Decoder

Encode or decode text to and from Base64.

About Base64 Encoder and Decoder

Base64 converts data into text characters that are safe to send in emails, URLs and APIs. Enter text and choose encode or decode. The tool handles UTF-8 characters. Remember that Base64 is not encryption and offers no protection.

Example

Input: Hello. Output: SGVsbG8=. Decoding SGVsbG8= returns Hello.

Tips for better results

  • Do not use Base64 to hide secrets.
  • Make sure there are no extra spaces when decoding.
  • For files, use the Image to Base64 tool.

When to use Base64 Encoder and Decoder

Use this tool when you need to move text through a channel that only handles plain characters, or when you meet a long string of letters and numbers ending in equals signs and want to see what is inside. Developers use it for basic auth headers, data URIs and email source, while IT staff and marketers sometimes decode a string found in a link or tracking parameter. It is a quick way to check what a Base64 value contains before trusting it.

Real-world uses

  • A developer builds a Basic Authorization header for an API test by encoding a username and password pair joined with a colon.
  • A support agent decodes a Base64 string copied from a webhook log to read the plain message that was sent to the customer.
  • A web designer decodes the text portion of a data URI found in a stylesheet to see what content is embedded there.
  • A student learning about web protocols encodes a short sentence and compares the longer output to see how Base64 grows data size.

Common mistakes to avoid

  • Treating encoded text as hidden or protected. Anyone can decode it in seconds, so passwords and keys encoded this way are still exposed.
  • Pasting URL-safe Base64, which uses dashes and underscores, into a decoder that expects the standard plus and slash characters, then wondering why the result is garbage.
  • Decoding a value that is really binary data, such as an image or a zip file, and expecting readable text. The output will look like random symbols.

How to use Base64 Encoder and Decoder

  1. Paste text into the Text box.
  2. Choose Encode or Decode.
  3. Copy the result. Text is handled as UTF-8, so accented letters and emoji work.

Worked examples

Example 1: “Hello, world!” with Encode.

Result: SGVsbG8sIHdvcmxkIQ==

Example 2: “Y2Fmw6k=” with Decode.

Result: café

Example 3: “not base64!!” with Decode.

Result: “That is not valid Base64.”

Limitations and things to check

  • Base64 is encoding, not encryption. Anyone can decode it, so never use it to hide passwords.
  • It handles text. To turn an image into Base64, use our Image to Base64 tool.
  • Encoded text is about a third larger than the original.

More tools like this: Developer & Data.

Frequently asked questions

Why is the encoded text longer than the original?

Base64 represents every three bytes of data as four text characters, so the result is roughly one third larger than the input. That growth is the cost of using only safe characters.

What are the equals signs at the end?

They are padding. Base64 works in groups of three bytes, and when the input does not fill the last group, one or two equals signs are added so the length stays a multiple of four.

What is Base64 used for?

Sending binary or special characters through systems that expect plain text, such as email attachments, data URIs and some API headers.

Why does the output end with = signs?

They are padding that makes the length a multiple of four characters. They are normal.

Is Base64 secure?

No. It provides no security. Use proper encryption for sensitive data.

Related tools

Related guides