base64

base64 test.txt -w0 > test-base64encoded.txt
base64 -d test-base64encoded.txt > test-output.txt

diff test.txt test-output.txt

-w0 allows for a very long base64 string, instead of each lines with fixed length

Padding

Base64 encoding increases file size by about 33%. The math works like this:

That’s 4/3 = 1.333…, or roughly a one-third increase.