So funktioniert es
The encoding is a fixed regrouping of bits, nothing more. Base64 reads the input three bytes at a time (24 bits) and re-slices those 24 bits into four 6-bit groups. Each 6-bit group maps to one of 64 characters — A-Z, a-z, 0-9, then + and / — producing four output characters for every three input bytes. When the input length is not a multiple of three, the final group is padded with = signs, which is why Base64 strings so often end in one or two equals characters.
That 3-to-4 relationship is why Base64 inflates data by roughly 33 percent: 3 bytes become 4 characters, 3 kilobytes become 4 kilobytes. The trade is deliberate. The output is guaranteed to contain no control characters, no quotes, no backslashes and no bytes above 127, so it can be embedded in a JSON string, a SQL literal or an HTTP header without any escaping at all.
A second alphabet exists because the standard one is hostile to URLs and filenames: + is interpreted as a space in a query string, and / is a path separator. URL-safe Base64 (RFC 4648 section 5) swaps those two characters for - and _ and usually drops the trailing padding. The two alphabets encode identical bytes; only the last two characters of the alphabet differ. Confusing them is the single most common cause of a signature that will not verify.
Decoding reverses the process: each character maps back to a 6-bit value, four values are concatenated into 24 bits, and those bits are split back into three bytes. Many decoders silently ignore invalid characters instead of failing, which is a real hazard — a truncated token copied from a log file will happily decode into plausible-looking garbage. This tool validates the input against the selected alphabet first and reports the offending character position.
Typische Anwendungsfälle
- Embed a small logo or icon inline in a CSS or HTML file as a data URL to remove one HTTP request.
- Inspect a data: URL copied out of a browser's network panel and recover the file it contains.
- Decode the payload segment of a JWT in a system that has no dedicated JWT tool to hand.
- Prepare a binary attachment for a SOAP or XML API that cannot carry raw bytes.
- Convert a certificate or key file to the Base64 form expected by a config file or environment variable.
- Diagnose a broken signature by confirming that the sender used URL-safe Base64 and the verifier expects the standard alphabet.
Zuletzt aktualisiert: 2026-10-14 — der Artikeltext wird auf Englisch angezeigt; die Oberfläche ist übersetzt.