Cryonel

Base64 Encoder & Decoder

Encode text or any file to Base64, or decode a Base64 string back to its original form. Runs entirely in your browser — your file is never uploaded anywhere.

How to use it

Type in the text box or choose a file, then click Encode to convert to Base64. To decode a Base64 string, paste it into the box and click Decode; UTF-8 text is handled correctly.

What Base64 does

Base64 represents arbitrary bytes with a restricted set of printable characters. It is useful when a text-only container must carry binary data, such as a JSON field, a MIME message, a configuration value, or a data URI. Encoding does not compress or protect the source. Anyone who receives the string can decode it, and the encoded value is normally larger than the original bytes.

Encode text and files correctly

Text is first converted to UTF-8 bytes, then those bytes are encoded. This matters for emoji, accented letters, and non-Latin scripts because treating JavaScript characters as single bytes corrupts them. File mode reads the selected file as raw bytes, so images, archives, certificates, and other binary formats are not interpreted as text. The result is produced in this browser tab and the selected file is never uploaded.

Expected size and padding

Base64 processes groups of three source bytes and emits four characters, so the encoded form is roughly one third larger before surrounding JSON or HTML escaping. One or two = characters may appear at the end as padding when the source byte count is not divisible by three. Some protocols omit padding, but a decoder must know which variant and rules the producer used. Do not remove characters simply to make a value shorter.

Standard Base64 versus Base64url

This page uses the standard alphabet containing + and /. URL-safe Base64 replaces them with - and _ and often omits padding. JWT header and payload segments use the URL-safe form, so a JWT segment should be handled by JWT Decoder instead of assuming it is ordinary Base64. Mixing alphabets is a common cause of invalid-character or padding errors.

Diagnose decoding failures

First remove transport formatting only when the protocol permits it; copied email bodies may contain line wrapping, while arbitrary spaces inside a token may indicate corruption. Check whether the value is Base64url, whether padding was intentionally omitted, and whether a data URI prefix such as data:image/png;base64, must be separated from the encoded payload. The Invalid Base64 guide covers these cases in more detail.

Security and operational limits

Never treat Base64 as encryption, hashing, signature verification, or secret storage. Encoded credentials remain credentials and should not enter logs, analytics, URLs, or source control. Decoding untrusted data can also produce a file whose type differs from its label, so validate length, expected media type, magic bytes, and downstream parser limits before saving or opening it. Browsers hold the input, decoded bytes, and output in memory; for large files, use a streaming application or command-line workflow with explicit size limits.

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is just an encoding that turns binary data into text — it provides no confidentiality, and anyone can reverse it.

Is it suitable for large files?

It works well for small-to-medium files (a few MB); very large files can be limited by your browser's available memory.

Does this page produce Base64url?

No. It uses standard Base64. JWT and URL-safe protocols replace two alphabet characters and may omit padding.

Related Tools