Encoding & Decoding

Base64 Encoder / Decoder

Encode text into Base64 or decode Base64 back into readable text, with full UTF-8 support and clear errors when the input isn't valid Base64.

Encoding and decoding happen entirely in your browser. Nothing is sent anywhere.

What this tool does

This tool converts text into Base64 (encode) or converts Base64 back into readable text (decode). It uses TextEncoder and TextDecoder internally so multi-byte characters such as emoji or non-Latin scripts survive the round trip correctly instead of becoming garbled.

Why security professionals use it

Base64 shows up everywhere in security investigations: encoded PowerShell commands in malware, data URIs hiding payloads in HTML, JWT tokens, and email attachments. Being able to quickly decode a Base64 blob during log review or phishing triage is a routine part of analyst work.

How it works

Base64 represents every 3 bytes of binary data as 4 printable characters from a 64-character alphabet, padded with = when needed. Encoding here uses the browser's btoa after converting text to UTF-8 bytes; decoding reverses that with atob and TextDecoder. Invalid input -- wrong characters, broken padding -- throws an error, which this tool surfaces as a friendly message instead of silently producing garbage.

Step by step

  1. 1Choose Encode or Decode.
  2. 2Paste or type your text or Base64 string into the input box.
  3. 3Read the result as it updates automatically.
  4. 4Use Swap to feed the result back in and flip direction, or Copy to grab the output.

Practical examples

Decoding the payload segment of a suspicious data URI found in an email to see what content it actually embeds. Decoding the value of an HTTP Basic Authentication header captured in a proxy log to reveal the (unencrypted) username and password it contains. Encoding a binary snippet so it can be embedded safely inside a JSON field or URL.

Common mistakes

  • Assuming Base64 hides or protects sensitive data -- it provides no confidentiality at all.
  • Forgetting padding characters (=) when manually constructing Base64 strings.
  • Mixing up URL-safe Base64 (using - and _ instead of + and /) with standard Base64.
  • Trying to decode text that has already been through another encoding step, such as URL encoding.

Security considerations

Because Base64 is trivially reversible, never rely on it to protect secrets -- always use real encryption for confidentiality. When investigating suspicious content, decoding Base64 is generally safe as an inspection step, but be cautious about executing or opening whatever the decoded content turns out to be, especially scripts or documents from an untrusted source.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 is an encoding scheme, not encryption. It has no secret key and provides no confidentiality -- anyone can decode Base64 text instantly. It is only meant to represent binary data safely as text.

Why do attackers use Base64 in malware and phishing?

Because it is reversible without a key, Base64 is often used to obfuscate malicious PowerShell commands, scripts, or URLs just enough to evade simple text-based filters and casual inspection, not to provide real protection.

Where else will I encounter Base64 in security work?

In JWT header and payload segments, HTTP Basic Authentication headers, data URIs embedded in HTML/CSS, email MIME attachments, and many API payloads and configuration files.

Why did my decode fail?

Base64 has a strict character set and padding rules. Extra whitespace, missing padding characters, or characters outside A-Z, a-z, 0-9, +, /, = will cause decoding to fail -- this tool reports that clearly rather than guessing.