CalculatorWala
Blog

Base64 Encoder/Decoder

Free Base64 Encoder/Decoder: convert text to Base64 and back instantly. Supports Unicode, URL-safe Base64, and one-click copy.

Base64, Quick Facts

  • Base64 encodes data into 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), safe for embedding in text, URLs, or JSON.
  • Base64 is encoding, not encryption. Anyone can decode it instantly; it adds no security.
  • Encoded output is roughly 33% larger than the original data, since every 3 bytes become 4 characters.
  • URL-safe Base64 replaces + and / with - and _ so the string can go directly into a URL.

The Real Problem This Solves

Binary data and special characters, images, credentials, JWT tokens, don't survive being pasted into JSON, a URL, or an email body without corruption. Base64 wraps them in plain text characters that travel safely anywhere.

The catch: it's easy to get Unicode text wrong (emoji and non-English characters often break naive encoders), and easy to mistake Base64 for encryption when it offers zero confidentiality.

How Base64 Encoding Works

Base64 takes your data 3 bytes (24 bits) at a time and repackages those 24 bits into four 6-bit chunks. Each 6-bit chunk, a value from 0-63, maps to one of 64 printable characters. If the input isn't a multiple of 3 bytes, = padding fills the gap.

Example: The text "Hi" (2 bytes) encodes to SGk=. The trailing = signals that the original data didn't fill a complete 3-byte group. Decoding reverses the process exactly, byte for byte, including full Unicode support.

InputBase64 Output
AQQ==
HiSGk=
SunU3Vu
CalculatorWalaQ2FsY3VsYXRvcldhbGE=

Frequently Asked Questions

Is Base64 encryption?

No. It is a reversible encoding scheme with no key, anyone can decode it in one line of code. Never use Base64 alone to protect sensitive data.

Why is my Base64 string longer than the original text?

Base64 always expands data by about 33%, since it converts every 3 raw bytes into 4 text characters, regardless of what the data actually is.

What is URL-safe Base64?

Standard Base64 uses + and /, both of which have special meaning inside URLs. URL-safe Base64 swaps them for - and _, and usually drops the = padding, so the encoded string can be used directly in a URL or filename without escaping.

Why did decoding fail on my string?

The input has to be valid Base64: only A-Z, a-z, 0-9, +, /, and = padding. Stray line breaks, missing padding, or a copy-paste error are the most common causes of a decode failure.

Where is Base64 actually used?

Embedding images inline in CSS or HTML (data URIs), encoding the header and payload of JWT tokens, attaching files in email (MIME), and passing binary data through text-only systems like JSON or XML.

Decoded a JWT or API payload?

That decoded string is almost always JSON underneath. Pretty-print and validate it with our JSON Formatter to actually read it.

Open JSON Formatter
Disclaimer: Base64 is an encoding format, not encryption or compression. Do not rely on it to secure sensitive information.