🇩🇪 Deutsch
← Back to Overview

Base64 Tool

What is Base64 Encoding?

Base64 is an encoding scheme that converts binary data into an ASCII string. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) plus the padding character "=". This encoding is essential for email attachments (MIME), data URLs in HTML/CSS, JSON Web Tokens (JWT), and API authentication.

How Does Base64 Work?

The algorithm divides input into 3-byte blocks (24 bits) and converts them into 4 Base64 characters. Each character represents 6 bits.

Example: Encoding "Hi"
"Hi" → ASCII: 72, 105 → Binary: 01001000 01101001
→ 6-bit groups: 010010 000110 1001xx
→ Padding: 010010 000110 100100
→ Base64 index: 18, 6, 36 → "SGk="

Note: Base64 increases data size by ~33%

Common Use Cases

Frequently Asked Questions (FAQ)

Is Base64 encryption?

No! Base64 is encoding, not encryption. Anyone can decode Base64. It provides no security – use it only for data transfer, not for protecting sensitive information.

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

The "=" is padding. Base64 works with 3-byte blocks. When input isn't divisible by 3, it's padded: 1 byte remainder → "==", 2 byte remainder → "=".

What is Base64URL?

A URL-safe variant that replaces "+" with "-" and "/" with "_". Used for JWT tokens and URLs, since +, / and = have special meanings in URLs.

How do I decode Base64 in JavaScript?

Encode: btoa("Text") | Decode: atob("VGV4dA==") | For UTF-8: btoa(unescape(encodeURIComponent(text))) and decodeURIComponent(escape(atob(encoded)))

💡 Tip: Embedding small images (<10KB) as Data URLs saves HTTP requests. For larger files, the 33% overhead outweighs benefits – use normal URLs instead.

Was sagt der BMI aus?

Der Body Mass Index ist eine Orientierungshilfe. Er setzt dein Gewicht ins Verhltnis zu deiner Krpergre.