Skip to content

Linux base64 Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux base64 Guide

Complete beginner-friendly guide to base64 on Linux, covering Arch Linux, CachyOS, and other distributions including encoding, decoding, and data conversion.


Table of Contents

  1. base64 Basics
  2. Encoding
  3. Decoding
  4. File Operations
  5. Troubleshooting

base64 Basics

Encode Text

Basic usage:

# Encode text
echo "Hello World" | base64

# Encodes text to base64

Decode Text

Decode:

# Decode base64
echo "SGVsbG8gV29ybGQ=" | base64 -d

# -d = decode (decodes base64)

Encoding

Encode String

Text encoding:

# Encode string
echo "Hello World" | base64

# Output: SGVsbG8gV29ybGQ=

Encode File

File encoding:

# Encode file
base64 file.txt

# Encodes file content

Decoding

Decode String

Text decoding:

# Decode string
echo "SGVsbG8gV29ybGQ=" | base64 -d

# Output: Hello World

Decode File

File decoding:

# Decode file
base64 -d encoded.txt > decoded.txt

# Decodes and saves to file

File Operations

Encode to File

Save encoded:

# Encode and save
base64 file.txt > encoded.txt

# Saves encoded content

Decode to File

Save decoded:

# Decode and save
base64 -d encoded.txt > decoded.txt

# Saves decoded content

Troubleshooting

base64 Not Found

Check installation:

# base64 is part of coreutils
# Usually pre-installed

# Check base64
which base64

Summary

This guide covered base64 usage, encoding, decoding, and data conversion for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally