Base64 Encode & Decode Online Free
Encode text to Base64 or decode it back to its original bytes, with proper UTF-8 handling, in your browser. No server round-trip.
In your browser—your files never leave your device.
Learn moreEncoded Base64 will appear here…About this tool
Base64 is the encoding scheme you reach for when you have to stuff arbitrary bytes through a text-only channel — a JSON field, an HTTP header, an env var, an SMTP body. RFC 4648 defines the alphabet (A-Z, a-z, 0-9, plus +, /, and = as padding) and that has not changed since 2006, but every language wraps it slightly differently and the same string can round-trip incorrectly if encodings mismatch on the way in. This tool runs Base64 in your browser using TextEncoder so non-ASCII input (accented characters, CJK, emoji) survives the trip intact, and the output is the standard alphabet your backend expects. The encoder produces deterministic output for any input, properly pads with = signs so the length is a multiple of four, and the decoder tolerates the missing-padding variant some APIs emit.
How to base64 encode & decode online free
-
Pick a direction
Toggle Encode or Decode at the top. Encode takes raw text and produces Base64. Decode takes Base64 and gives you the original bytes interpreted as UTF-8. Switching modes clears the input box so you do not run the wrong direction by accident.
-
Paste your input
Drop your text or Base64 string into the input box. The conversion happens automatically — there is no submit button. Long inputs (a few megabytes) work but slow noticeably; for those, a CLI is faster.
-
Read the result
Output appears below the input as soon as you paste. If decoding fails — malformed Base64, non-text bytes, missing padding the parser cannot reconstruct — you will see an "Invalid Base64 input" message instead of a corrupted string, so you know to check the input rather than chase a wrong decoded value.
-
Copy with one click
The copy button next to the output puts the result on your clipboard ready to paste into a config file, env var, curl command, or test fixture. The clipboard copy uses the Clipboard API and works on any modern browser including mobile.
Why use this tool
I use this constantly when debugging API integrations. Webhook payloads frequently come in Base64-encoded — Stripe event objects sometimes do, Twilio signed requests do, AWS SNS does — and I need to crack one open to see what is actually inside. Auth headers are the other big one: HTTP Basic Auth is "username:password" base64-encoded, and when something fails I want to verify the credential is correct before blaming the server. The third case is encoding a small binary blob (a PNG icon, a public key, a small PDF) into JSON or a config file. Doing it in the terminal works but loses focus; doing it in a tab next to your code keeps you moving. The fourth case is debugging email attachments: MIME-encoded mail bodies use Base64 for binary parts, and pasting the encoded chunk in here is the fastest way to see what is in an attachment without a full mail client. And because this tool never POSTs your input, you can paste a real auth token without thinking twice — open DevTools, switch to the Network tab, paste a secret, and watch: zero outbound requests.
Features
Both directions in one tool
Encode any text to Base64, or decode a Base64 string back to its original form. One toggle, same input box, instant output. The encoder uses the modern TextEncoder approach so it handles UTF-8 correctly without the legacy escape/unescape pattern from older guides that silently mangles non-ASCII characters. Switching modes clears the input so you do not get confused about what direction you are running.
UTF-8 safe by default
Old guides still say "btoa(unescape(encodeURIComponent(s)))" but TextEncoder is the right way now. This tool encodes via TextEncoder.encode() so an emoji or an accented character produces the same Base64 your Python base64.b64encode or Go base64.StdEncoding.EncodeToString produces. No silent mojibake when round-tripping between systems with different default encodings, no surprise replacement characters on the decoded side.
Standard alphabet with padding
Standard Base64 (RFC 4648 section 4) uses A-Z, a-z, 0-9, +, /, and pads with = to make the output length a multiple of four. This tool emits proper padding on encode and tolerates missing padding on decode, which matters because some APIs strip = from URLs and you would otherwise get an InvalidCharacterError when you paste it back. The URL-safe variant (RFC 4648 section 5) uses - and _ instead — JWTs use this; if you need to round-trip those, the JWT decoder shows the inside-the-token form.
Stays local — confirmed in DevTools
Encoding and decoding run in your browser via the built-in btoa and atob, plus TextEncoder/TextDecoder for proper byte handling. Nothing is POSTed anywhere. You can open the network tab in DevTools, paste an API key or a private SSH key, and confirm there are zero outbound requests. Important if your security policy frowns on third-party tools or if you are inside a corporate firewall where credential exposure is logged.
Predictable 33% size overhead
Base64 turns every 3 input bytes into 4 output characters, which works out to exactly 4/3 ≈ 1.333x the input size before padding. A 100KB image becomes about 133KB encoded; a 1MB file becomes about 1.33MB. The padding adds 0, 1, or 2 extra characters depending on whether the input length is a multiple of 3. If you are estimating bandwidth for a data URI or inline asset, this is the math. The encoded output also adds 1 byte of overhead for every 76 characters if you wrap lines (MIME convention) — most modern decoders accept unwrapped Base64 anyway and the tool emits the single-line form.
Privacy & security
Encoding and decoding both run on btoa, atob, TextEncoder, and TextDecoder — built-in JavaScript functions that live in your browser, not on our server. The textarea you paste into is a DOM element, the conversion is one function call, and the output appears in another DOM element. Open the Network tab, paste an API key, switch direction, and watch: zero outbound requests. Important for the cases where you actually want to encode a credential — Basic Auth headers, signed token components, anything sensitive — without trusting a third party.