Base64 Encoder / Decoder
Convert text to Base64 and back — UTF-8 safe, strict validation, nothing leaves your browser.
Input
All processing stays in your browser. Nothing is stored or transmitted, and your input text is never rewritten.
Result
Encoding is always UTF-8 first; decoding validates the base64 shape strictly and then reads the bytes as UTF-8 with no silent character replacement.
Binary bytes (hex)
Reading decoded bytes as text and decoding base64 are two different steps: base64 decoding always succeeds to bytes; presenting those bytes as text only works when they are valid UTF-8. Invalid bytes are shown above as hex, never replaced with random text.
About this tool
Base64 Encoder / Decoder works byte-exact: text is encoded to UTF-8 first, and decoding validates the base64 alphabet, length and padding before a fatal UTF-8 read.
- Encode any text (Arabic, emoji, ZWJ sequences) by encoding to UTF-8 bytes first — btoa is never used on raw Unicode text.
- Decode strictly: base64 alphabet, length and padding are validated before a fatal UTF-8 read, so invalid bytes are never silently replaced with U+FFFD.
- Standard (+/ ) and URL-safe (-_ ) alphabets supported in both directions; padding can be completed automatically or required exactly.
- Swap input/output, copy input, copy result, download result; decoded bytes that are not valid UTF-8 are shown as labelled hex or downloadable raw .bin bytes.
- Inputs above 1 MB are refused. Nothing is executed, uploaded or stored.
Standard and URL-safe alphabets are accepted on decode (mixed usage is labelled). Padding can be completed automatically or required strictly — the option never rewrites your input text. Input above 1 MB is refused. This tool does not decode base64 images or attach keyboard volume; decoded bytes that are not valid UTF-8 are offered as hex or a raw .bin download with an explicit binary warning.