# Free Online Base64 Encoder and Decoder

> Encode and decode Base64 in your browser, standard or URL-safe alphabet. Full UTF-8 support, so emoji and accents survive intact. Free online.

Canonical: https://stayslocal.app/dev/base64-encoder-decoder
Last updated: 2026-08-16

Base64 turns arbitrary bytes into 64 printable characters so they can travel through something that only carries text — a JSON field, an email header, a data URI. It is an encoding, not encryption: anyone can decode it, which is the entire point.

## RFC 4648, and the two alphabets

RFC 4648 defines two alphabets over the same algorithm. §4 is standard Base64, ending in + and /. §5 is base64url, which swaps those for - and _ so the result is safe in a URL path or query string and in a JWT segment. Decoding the wrong alphabet does not always fail loudly — it can produce different bytes, which is how a corrupted signature ends up looking like a mystery.

Fields:
- Standard (§4): A-Z a-z 0-9 + / — the default, correct for MIME, data URIs and most APIs.
- URL-safe (§5): A-Z a-z 0-9 - _ — required inside JWTs and anywhere the value goes into a URL.
- Padding: = pads the output to a multiple of four characters. base64url usually drops it; JWT segments are always unpadded.
- Size: Output is 4 characters per 3 input bytes — about 33% larger than the original, before any padding.
- UTF-8: Text is encoded as UTF-8 bytes first. The browser's own btoa() throws on anything outside Latin-1, which is why naive implementations break on é or an emoji.

## How to encode and decode Base64 online

1. Paste text or Base64 — Encoding and decoding are the same box; the direction is a toggle.
2. Choose standard or URL-safe — Use URL-safe for anything that will sit in a URL or a JWT segment.
3. Copy the result — Padding is added or omitted to match the alphabet you picked.

## Where Base64 shows up

- Reading the value behind a data: URI in a stylesheet or an email.
- Decoding a Basic auth header to check which user an integration is sending.
- Building the Authorization value for a quick API test by hand.
- Inspecting a base64url segment copied out of a token or a signed URL.

## Questions

**Is Base64 a form of encryption?**

No. It is a reversible encoding with no key and no secret — anything Base64-encoded is readable by anyone who bothers to decode it. Use it to make bytes transportable, never to hide them.

**Does what I paste get uploaded?**

No. Encoding and decoding happen in this browser tab, which matters when the string is an auth header or a private key you would not paste into a server-side tool.

**Why does my decode produce garbage?**

Usually an alphabet mismatch: a base64url string decoded as standard Base64, or the reverse. Missing padding and stray line breaks copied out of an email header do it too.

**Can I Base64-encode a file here?**

This tool handles text — a file's raw bytes are not valid UTF-8, so this decoder will refuse them. For an image, use Image ↔ Base64 instead, which reads bytes directly rather than assuming text. For a file's fingerprint, use the checksum tool.

## Related

- [URL Encode](https://stayslocal.app/dev/url-encoder-decoder): Percent-encode and decode URLs
- [JWT Decoder](https://stayslocal.app/dev/jwt-decoder): Decode a JSON Web Token's claims
- [Image ↔ Base64](https://stayslocal.app/image/image-to-base64): Encode an image to a data URI, or decode one back
- [Developer Tools](https://stayslocal.app/dev): every tool in this family
