Base64 Encode & Decode
Encode text to Base64 or decode Base64 back to text. Full UTF-8 support, padding and wrapped lines handled, and a Swap button to check the round trip.
About the Base64 Encode & Decode
Base64 turns arbitrary bytes into a safe alphabet of letters, digits, plus and slash so binary data can travel through channels that only tolerate plain text. This tool converts text to Base64 and back in both directions with full UTF-8 safety, so emoji, Devanagari script and other multi-byte characters survive intact. A Swap button drops your last result straight into the input for a round-trip check, and nothing you type is ever transmitted.
Why Base64 exists at all
It was designed to carry binary through a text-only channel, not to hide anything. Early mail and terminal systems could reliably move seven-bit ASCII text and nothing else, so a JPEG, a font file or a byte array with values above 127 had no safe representation. Base64 solves that by re-expressing every group of three bytes as four printable characters from a fixed 64-letter alphabet: A to Z, a to z, 0 to 9, plus + and slash /. Every one of those is unambiguous in text, JSON, a URL query or a config file, which is why the format turned up in MIME email attachments, HTTP Basic auth headers, data URLs and JSON Web Tokens. The cost is size.
See also: URL Encoder & Decoder·Verified exam photo and signature specs
The 4:3 ratio and the 33% overhead
Three bytes in, four characters out — that is the arithmetic of the format. When the input length divides evenly by three the output is exactly one third longer, because 4 ÷ 3 = 1.3333. 'Man' is three bytes and encodes to 'TWFu', four characters. When it does not divide evenly the last group is padded with one or two '=' signs, so short inputs cost more: 'Rupix Tools' is 11 bytes and comes out at 16 characters, 45% larger, and a single 'M' becomes 'TQ=='. Pad up to a multiple of three bytes and the overhead settles back to exactly a third. So the honest statement is: Base64 costs about a third more space than the bytes it carries, plus up to two padding characters. It is a transport format, not a compression format.
Standard Base64 versus URL-safe Base64
RFC 4648 defines two alphabets. The standard one uses + and slash for the last two values and pads with =. The URL-safe variant, usually called Base64URL, swaps those for hyphen - and underscore _ and drops the padding, because + and slash need percent-encoding to survive a URL path. JSON Web Tokens use Base64URL for exactly that reason. A plain Base64 decoder rejects a Base64URL string outright: feed it a segment containing '-' or '_' and the browser throws an InvalidCharacterError rather than producing something plausible. That is a safety feature. Substitute the two characters back and add padding if the length needs it, or use the JWT decoder on this site, which normalises them for you.
See also: JWT Decoder
UTF-8, and the failure modes you will hit
The browser's legacy btoa function only accepts code points below 256, so calling it directly on an emoji or on Hindi text throws. This tool routes the string through a UTF-8 encoder first and mirrors that on the way back, which is why multi-byte characters round-trip here. The decoder is forgiving in useful ways: leading and trailing whitespace is ignored, so are newlines anywhere inside the string, and a missing trailing '=' is tolerated — 'YWI' decodes to 'ab' exactly as 'YWI=' does. What it will not accept is a character outside the alphabet. Three cases account for nearly every failure: a data URI pasted whole ('data:image/png;base64,iVBORw0KGgo=' fails, because the prefix is not Base64 — cut everything up to the comma), a Base64URL string with '-' or '_', and a length exactly one character modulo four. When the bytes were never meant to be text, decoding succeeds and still looks wrong: the PNG header bytes iVBORw0KGgo come back as replacement characters.
See also: JSON Formatter & Validator
How to Use Base64 Encode & Decode Online
Follow these simple steps to use Base64 Encode & Decode securely in your web browser.
- 1
Choose Encode or Decode
Encode turns your text into Base64. Decode turns a Base64 string back into readable text.

- 2
Paste or type your input
Put the text (or the Base64 string) in the box. Multi-byte characters such as emoji and other scripts are handled.

- 3
Copy the result
Click Copy to put the converted value on your clipboard, or Swap to feed the result back in and check the round trip.
Features & Specifications
Standard
RFC 4648 Base64 (standard alphabet, A-Z a-z 0-9 + /)
Character Encoding
UTF-8 via TextEncoder/TextDecoder
Engine
Native btoa/atob with Uint8Array buffers
Size cost
4 characters per 3 bytes, plus = padding
Privacy Status
100% In-Browser Local Processing
100% Free & Private In-Browser Processing
Every tool on this site runs on a zero-upload architecture. All computations, file parsing, and transformations occur locally inside your web browser. No document bytes, sensitive text, or personal data are ever uploaded or transmitted to remote servers.
Why use Rupix Base64 Encode & Decode?
UTF-8 Character Safety
Handles multi-byte Unicode characters, non-Latin alphabets, and emojis without the corruption naive converters produce.
Forgiving Decoder
Leading and trailing whitespace, embedded newlines and a missing trailing '=' are all tolerated; anything outside the alphabet is rejected clearly.
Swap for Round Trips
One tap feeds your last result back in as the input, so you can confirm a value survives the trip in both directions.
Zero Data Transmission
Operates 100% client-side via TextEncoder and TextDecoder.