If you need to decode Base64 data to ASCII or encode ASCII text to Base64, these are some of the available tools to do it.

Table of Contents



This tool is likely installed on your system (from coreutils package), and it’s very simple:

Encode to Base64:

  • File: base64 somefile.txt
  • Text: echo -n "test" | base64. If you omit -n, or you run base64 <<< "test", base64 will also encode the trailing newline.

Decode from Base64:

  • File: base64 -d somefile.txt
  • Text: echo "dGVzdA==" | base64 -d, or base64 -d <<< "dGVzdA==".


Text pieces

Available on Flatpak, this tool can make quick text transformations, including Base64 encoding/decoding. You can find more info on my previous post: Text Pieces: the Swiss Army Knife of text processing.

Text Pieces


You can also encode/decode using Javascript. Use these functions:

  • Encode to Base64 (ASCII to Base64): atob('test').
  • Decode from Base64 (Base64 to ASCII): btoa('dGVzdA==').

If you have any suggestion, feel free to contact me via social media or email.