All tools
64

Base64 Encoder/Decoder

Encode text or files to Base64, or decode a Base64 string back to plain text.

Encoding & hashing
input.txt
0 chars
output.b64
0 chars
Overview

About this tool

Encode any text or file into Base64 — a way of representing binary data using only 64 printable ASCII characters — or decode a Base64 string back into its original content. Both directions run live as you type or upload.

01

What Base64 is actually for

Base64 isn't compression and it isn't encryption — it's a format conversion. It exists because some systems (older email protocols, JSON, XML, URLs) were only designed to carry plain text safely, not arbitrary binary bytes. Base64 re-represents those bytes using a 64-character alphabet of letters, digits, + and /, so binary data — an image, a PDF, a Basic Auth credential — can travel through a text-only channel without corruption.

02

Standard vs URL-safe alphabet

Standard Base64 uses + and / in its output, both of which have special meaning inside a URL's query string. URL-safe Base64 swaps them for - and _ instead, so the result can be dropped directly into a URL or filename without extra percent-encoding. If you're decoding something that came from a URL or a JWT and it isn't working, try the URL-safe option.

03

Common uses

Reading the header and payload segments of a JWT, which are Base64 URL-encoded, decoding a Basic Auth Authorization header to see the embedded username and password, embedding a small image directly into CSS or HTML as a data: URL, or converting a binary file into text so it can be pasted into a JSON field.

Frequently asked questions

Is Base64 secure?

No — it provides no security at all. Anyone can decode Base64 instantly with no key or password required. It's a text-safe encoding, not an encryption method; never rely on it to protect sensitive data.

Why does decoding sometimes produce unreadable text?

If the original data was binary — an image, a compressed file — decoding it and displaying the raw bytes as text will look like garbled characters. That's expected; the bytes themselves are still correct, they just aren't meant to be read as text.

Can I encode an entire file, not just typed text?

Yes — use the file upload option to Base64-encode any file's raw bytes directly.