Base64 encode/decode tools
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
CLI
base64
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 runbase64 <<< "test"
,base64
will also encode the trailing newline.
Decode from Base64:
- File:
base64 -d somefile.txt
- Text:
echo "dGVzdA==" | base64 -d
, orbase64 -d <<< "dGVzdA=="
.
GUI
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.
Javascript
You can also encode/decode using Javascript. Use these functions:
- Encode to Base64:
btoa('test')
. - Decode from Base64:
atob('dGVzdA==')
.
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: