Although there are a number of websites that allow to convert file to base64 and vice versa. However, it could leads to data leak issue if these data from your working project.
Therefore, I would like to introduce a tip to convert file to base64 (and vice versa) offline.
1) Encode file (ex: pdf) to base64:
base64 -w 0 test1.pdf
2) Encode a file to base64 and write it to file:
base64 -w 0 test1.pdf > test1.txt
3) Decode base64 to file:
base64 -d test1.txt > test1.pdf
Tool need to use:
- Linux: use the default cmd
- Window: use the git bash which I believe all the developers already installed
Top comments (0)