calculatory.app

Base64 Encoder / Decoder

Convert text to Base64 or decode it back. Full Unicode support and an optional URL-safe alphabet.

0 bytes → 0 bytes

How this tool works

Encoding uses TextEncoder to correctly convert Unicode text (including emoji, accented characters, and non-Latin scripts) into UTF-8 bytes before Base64-encoding — a plain btoa() call breaks on any character outside the Latin-1 range, which is a common source of encoding bugs. Decoding reverses the process with TextDecoder, so round-tripping text through encode and decode always returns exactly what you started with.

Common questions

What is Base64 encoding actually for?

Base64 converts arbitrary binary data into a string of only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), which is safe to embed in contexts that only handle text — email attachments, JSON payloads, URLs, data: URIs for inline images, and HTTP authentication headers. It's an encoding for safe transport, not a form of encryption or compression.

Is Base64 encryption or a form of security?

No — Base64 is fully reversible by anyone with no key required; decoding is trivial and instant, as this tool demonstrates. Never use Base64 to 'hide' or protect sensitive data like passwords or tokens. It only exists to make binary-safe data representable as plain text, nothing more.

Why does Base64 output end with = or == sometimes?

Base64 processes input in 3-byte chunks and produces 4 output characters per chunk. When the input length isn't a multiple of 3, padding characters (=) are added to fill out the last group — one = for a remainder of 2 bytes, two == for a remainder of 1 byte. The padding is a marker for decoders, not part of the actual data.

Why did decoding my Base64 string fail?

The most common cause is that the string was copied incompletely or has stray whitespace/line breaks inserted (common when Base64 is split across multiple lines in email or config files) — remove line breaks and confirm nothing was truncated. It can also happen if the string uses URL-safe Base64 characters (- and _ instead of + and /) and needs converting to standard Base64 first.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses + and / as two of its 64 characters, both of which have special meaning inside a URL, so they'd need to be percent-encoded if embedded directly. URL-safe Base64 replaces those two characters with - and _ instead, so the result can be dropped directly into a URL path or query string without additional encoding. Padding (=) is also sometimes omitted in URL-safe contexts since it can conflict with query-string syntax.

Gaurav Yadav

Built by Gaurav Yadav

Designer, author, and the one person behind Calculatory. All encoding runs in your browser — nothing is sent to a server. More about the project.

Last updated: September 2026