How to use it

  1. Type or paste your text in the top box.
  2. Press Encode to Base64 to turn text into Base64.
  3. Press Decode from Base64 to turn Base64 back into text.
  4. Tick URL-safe Base64 if the result goes into a URL or a file name.
  5. To encode a file, pick it with the file box. The file can be up to 5 MB.
  6. Press Copy result.

After you press a button, the result updates as you type. The text and the files stay in your browser. Nothing is uploaded.

PowerShell -EncodedCommand

PowerShell can run a script that is passed as one Base64 string. Admins use this to avoid quoting problems in scheduled tasks, SCCM command lines and remote commands.

  1. Paste your script in the top box.
  2. Press Script to PowerShell -EncodedCommand.
  3. Copy the line that starts with powershell.exe -EncodedCommand.

To read an encoded command you found in a log or a task, paste it and press PowerShell -EncodedCommand to script. You can paste the whole command line or only the Base64 part. The short forms -enc, -ec and -e work too.

PowerShell does not use the same Base64 as the plain buttons. It wants the text as UTF-16LE, with two bytes for each character. That is why the plain Decode button fails on an encoded command, and why dir becomes ZABpAHIA and not ZGly.

What is Base64?

Base64 writes any data with 64 safe characters: A to Z, a to z, 0 to 9, plus and slash. Every 3 bytes become 4 characters, so the result is about one third larger. An equals sign at the end fills the last group.

Base64 is used where only plain text is allowed: email attachments, data URLs, JSON fields, certificates and config files.

Base64 is not encryption. Anyone can decode it. Do not use it to hide a password.

What is URL-safe Base64?

Plus and slash have a meaning in URLs. URL-safe Base64 uses a hyphen and an underscore in their place, and leaves off the equals signs. Web tokens such as JWTs use this form. The decoder reads both forms, so you do not need to tick the box to decode.

Text encoding

The plain buttons use UTF-8. Accented letters, other alphabets and emoji all survive a round trip.

Questions

Why does my decoded text look wrong or fail?

The Base64 probably holds something other than UTF-8 text. If it came from a PowerShell command line, use the PowerShell button. If it is a file, such as an image, it has no readable text.

Is Base64 safe for passwords?

No. Base64 only changes how data is written. Anyone can decode it in a second. An encoded PowerShell command is just as easy to read as a plain one.

How long can an encoded PowerShell command be?

A command typed in cmd.exe can be 8,191 characters at most. The encoded form is long: each character of the script takes almost three characters of Base64. Keep encoded scripts short, or put the script in a file and run it with -File.