Tinkr
All tools
Developer·Live· Encoded in your browser

Base64 Encoder / Decoder

Encode any text to Base64, or decode a Base64 string back to text. UTF-8 safe (works with emoji, CJK, accented characters), with an optional URL-safe variant for tokens and APIs. Runs entirely in your browser.

Frequently asked questions

What is Base64 and why is it used?
Base64 is an encoding that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It's used when you need to send binary data through systems that only accept text — embedding images in HTML/CSS (data: URIs), encoding email attachments (MIME), JWT tokens, and most HTTP authentication schemes.
Is my input sent to a server?
No. The encode and decode steps run entirely in your browser using TextEncoder, TextDecoder, btoa, and atob — all standard JavaScript built-ins. You can disconnect from the internet and the tool keeps working. Safe for tokens, secrets, and sensitive payloads.
Does it handle emoji, CJK characters, and accented characters?
Yes. The tool uses TextEncoder to convert your text to UTF-8 bytes before encoding, so any Unicode character works — emoji (🚀), Japanese (こんにちは), accented characters (café), Arabic, Cyrillic, etc. The plain `btoa()` API would fail on these; we wrap it correctly.
What is URL-safe Base64?
URL-safe Base64 (RFC 4648 §5) replaces `+` with `-` and `/` with `_`, and drops the trailing `=` padding. It's used in places where standard Base64 would break URLs or filenames — JWTs, OAuth tokens, JSON Web Encryption (JWE), and most modern web APIs. Toggle it on if your destination expects this variant.
Why is my Base64 longer than the original text?
Base64 expands input by roughly 33% — 3 input bytes become 4 output characters. That's the trade-off: text-safe transmission costs space. If size matters and you don't need text safety, use raw bytes or a more compact encoding like Base85.
Can I encode files (images, PDFs) here?
Not in this tool — it's text-only. For files, use the JWT Decoder's pattern of file dropping (we'll add file Base64 in a future update). For now, on macOS/Linux you can run `base64 < file.png` in the terminal; on Windows, `certutil -encode file.png out.txt`.
What if my Base64 input is missing the trailing equals signs?
The decoder is lenient — it pads automatically. URL-safe Base64 omits the `=` padding by spec, and many APIs strip it for compactness. Whether you paste with or without `=` at the end, the decoder handles it.
Is Base64 encryption?
No. Base64 is encoding, not encryption. The data is reversible by anyone — no key required. Never use Base64 to 'protect' sensitive data. If you need confidentiality, encrypt the data first (e.g., with libsodium or Web Crypto's AES-GCM), then Base64-encode the ciphertext for transmission.

Related tools