Blog
Custom Print on Demand Apparel — Free Storefront for Your Business
Wild & Free Tools

Base64 Encode & Decode — Mac, Linux, Windows, Browser (Quick Reference)

Last updated: March 20267 min readDeveloper Tools

Platform Quick Reference

TaskMac / LinuxWindows (PowerShell)
Encode textecho -n "text" | base64[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("text"))
Decode textecho "dGV4dA==" | base64 -d[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("dGV4dA=="))
Encode filebase64 file.png[Convert]::ToBase64String([IO.File]::ReadAllBytes("file.png"))
Decode to filebase64 -d encoded.txt > file.png[IO.File]::WriteAllBytes("file.png",[Convert]::FromBase64String($b64))

Note: Mac uses base64 -D (capital D) for decode, while Linux uses base64 -d (lowercase). This trips up everyone switching between systems.

Don't want to remember terminal syntax? The browser-based Base64 tool works on every platform — paste text or drop a file, get the result instantly.

When You Actually Need Base64

Common Gotchas

Browser Tool vs Terminal — When to Use Each

Use the terminal when you are already in the command line (scripting, piping output, CI/CD). The one-liners above are fastest when you are already in a shell session.

Use the browser tool when:

Try Base64 Encoder — free, private, unlimited.

Open Base64 Encoder
Launch Your Own Clothing Brand — No Inventory, No Risk