UnixDroid

Security · Linux command

base64 command in Linux

What does base64 do?

base64 encodes data into plain text characters and decodes it back with -d. It is encoding, not encryption — anyone can decode it.

base64 [-d] [file]

Most useful options

OptionWhat it does
-ddecode
-w 0no line wrapping

base64 examples

$ echo hello | base64 Try it ›

aGVsbG8K

$ echo aGVsbG8K | base64 -d Try it ›

hello

$ base64 -d secret.txt Try it ›

decode a file

In security work

Malware and CTF flags often hide in Base64. Strings ending in = or == are a hint.

Questions about base64

Is Base64 encryption?

No. It has no key — it only changes the format. Never use it to protect passwords.