bitcalc

📝 Base64 Encoder/Decoder

Text ↔ Base64 — live codieren und decodieren.

Base64

{ } Base64 konvertiert? Jetzt JSON formatieren.

📝 What is Base64 for?

Base64 encodes binary data into printable ASCII characters — used in email attachments, Data URIs, JWT tokens, and configuration files.

📝 Base64 — The Swiss Army Knife of Text Encoding

What is Base64?

Base64 is an encoding method that converts binary data into a printable ASCII string. It uses a 64-character alphabet (A–Z, a–z, 0–9, +, /) and represents each 6 bits of input as one Base64 character. The result is about 33% larger than the original data — the price for portability in text-based protocols. The equals sign = serves as padding when input is not divisible by 3.

Common Use Cases

JWT Tokens: JSON Web Tokens consist of three Base64-encoded segments (Header, Payload, Signature) — analyze their content in seconds with our decoder.

Data URIs: Images, fonts, or SVGs are embedded as data:image/png;base64,... directly in HTML/CSS — no separate HTTP request needed.

Email Attachments (MIME): Every file attachment in an email is Base64-encoded — which is why emails with attachments are about ⅓ larger than the raw file size.

Basic Authentication: HTTP Basic Auth sends username:password as a Base64 string in the Authorization header.

Kubernetes Secrets / Docker Configs: Sensitive values in K8s manifests and .dockerconfigjson are Base64-encoded.

CSS Background Images: Small icons can be embedded as Base64 data URIs directly in stylesheets, saving HTTP requests.

Base64 vs. Hex vs. URL Encoding

Hexadecimal encoding requires 2 characters per byte (100% overhead), Base64 only 1.33 characters per byte (33% overhead) — Base64 is significantly more compact. URL encoding (%20 for spaces) is optimized for query strings, not binary data. For human-readable debug output, Hex is often more practical; for data transfer, Base64 is the standard.

How Our Encoder Works

Encoding and decoding happens live as you type — enter text on the left, and the Base64 equivalent appears instantly on the right. The decoder works bidirectionally: Base64 input is also decoded back to plaintext in real time. Everything happens client-side in your browser. No data is sent to any server.

🧰 What Do You Need the Encoder For?

You have a JWT token from an auth log or the browser console and want to read it quickly. You want to embed an image as a data URI directly in HTML or CSS instead of hosting an extra file. Or you stumble across API credentials in a config and wonder what is actually in there. In all three cases the decoder helps: paste the text or Base64 string, and the reverse representation appears live — without anything leaving your browser.

🧭 Decoding a JWT — How to Read a Token

Copy the whole token from the log — it looks like eyJhbGciOi... and consists of three parts separated by dots.

Paste the token into the left field. The decoder shows you the three segments: header (algorithm and type), payload (the actual claims), and signature.

Read the payload — caution: it is only Base64-encoded, not encrypted. Anyone who sees the token can read it. So never put secrets or passwords into the payload.

⚠️ Base64 Is Not Encryption

The most common misconception: Base64 looks like “secret code” but is only an encoding — like a different way of writing the same text. Anyone with a Base64 decoder (like this one) has the plaintext within seconds. There is no key, no protection, no integrity check. If you really want to protect data, you need encryption (e.g. AES) — and even then: never roll your own crypto.

= Why Is There Sometimes an Equals Sign at the End?

Base64 processes the input in 3-byte blocks (24 bits), split into four 6-bit characters. If one or two bytes remain at the end, one or two equals signs (=) pad the output so the length is divisible by 4 again. A single = means: 1 byte left over. Two ==: 2 bytes. No =: the input was cleanly divisible by 3. Padding is not an optional extra — some parsers throw an error without it.

❓ Frequently Asked Questions

Is Base64 safe for passwords?

No. Base64 is a pure encoding — anyone can decode your string. Passwords belong in a slow, salted hash algorithm (bcrypt, Argon2), never in Base64.

What is the difference to Hex?

Both encode bytes as text, but Base64 is much more compact: it needs 4 characters for 3 bytes (33 % overhead), Hex 2 characters per byte (100 % overhead). A 1 KB file becomes roughly 1.33 KB in Base64, 2 KB in Hex.

Where else does Base64 show up?

MIME email attachments (which is why emails with attachments are larger than the file), Kubernetes secrets (only Base64 — the secret itself is not encrypted either!), CSS data URIs for images and fonts, JWT tokens, HTTP Basic Auth, and .dockerconfigjson.

How do I recognize Base64?

By the character set: only A–Z, a–z, 0–9, + and / — often with one or two equals signs at the end. Typical lengths are multiples of 4. If you see eyJ..., it is very likely a JWT (Base64url).

📚 Sources & Further Reading

The official specification is RFC 4648 (Base16, Base32, Base64). Our blog post Encoding vs. Hashing vs. Encryption explains the difference between encoding, hashing, and encryption. And if that Base64 string was actually JSON: JSON Formatter.