Base64 Encoder & Decoder
Convert text to Base64 and back, with accents, emoji and every other character encoded as proper UTF-8. You can also turn a file into Base64 or a data URI, or rebuild a file from Base64. Nothing you type or choose is sent to a server — it is processed in your browser.
Type or paste something and the result appears here instantly.
File → Base64 · data URI
Base64 → file
What is Base64?
Base64 (RFC 4648) represents any binary data using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so the output is about 33% larger,
and = pads the end to a multiple of four. It is an encoding, not encryption — anyone can decode it, so never use it to hide passwords.
You meet it in email attachments (MIME), HTTP Basic auth headers (user:pass → dXNlcjpwYXNz), JWTs, data URIs that inline images in HTML or CSS, and binary fields inside JSON.
Decoded a JWT payload? Pretty-print it with the JSON formatter.
Why accents and emoji break — and how UTF-8 fixes it
Base64 encodes bytes, not characters. The same word gives different Base64 depending on which character encoding turned it into bytes:
| Text | Encoding | Base64 |
|---|---|---|
| café | UTF-8 (this tool, the web standard) | Y2Fmw6k= |
| café | ISO-8859-1 / Latin-1 | Y2Fm6Q== |
| café | UTF-16LE (Windows, PowerShell) | YwBhAGYA6QA= |
JavaScript's built-in btoa("🙂") throws an error, and some sites silently mangle non-ASCII text. This tool always uses UTF-8, so its output matches base64 on Linux and macOS, Python's base64.b64encode(s.encode()) and most APIs.
When decoded bytes are not valid UTF-8, it offers them as a file download instead of showing garbled text.
URL-safe Base64, wrapping and data URIs
- URL-safe (RFC 4648 §5) swaps
+and/for-and_and drops the=padding, so the result can sit in a URL, a filename or a JWT. The decoder accepts standard, URL-safe and unpadded input automatically. - 64-character lines match PEM certificates and keys (
-----BEGIN CERTIFICATE-----); 76 matches MIME email bodies. Whitespace and line breaks are ignored when decoding. - Data URIs such as
data:image/png;base64,…go straight into<img src>or CSSurl(). Use them for small icons only: a large photo grows by a third and can't be cached separately. Shrink photos first with the image compressor.
FAQ
Is my text or file uploaded anywhere?
No. Encoding, decoding and file conversion all happen in your browser; nothing is sent to a server or stored. It is safe for auth headers, API tokens and private documents.
How does "Base64 → file" pick the file type?
For a data URI it uses the declared type (for example image/png). Otherwise it reads the file signature in the first bytes — PNG, JPEG, GIF, WebP, PDF, ZIP, MP3, MP4 and more — and falls back to .bin.
Why do I get "invalid Base64 character"?
Usually quotes or commas came along with the copy, or a prefix like Basic or Bearer is still attached. Remove the character at the reported position and try again. A truncated string gives a length error instead.
Sources
Found this useful? Share it
Only the page link is shared. Your inputs and files are never included.