This page turns text into Base64 and turns Base64 back into text. It reads the input as UTF-8, so accented letters, CJK characters and emoji survive the round trip, and it writes the result in the text area beside the form. Decoding works the other way: paste a Base64 value and the page returns the original text, or explains why the string could not be read.
Both directions run in the tab. The text is not posted to a server, and there is no account or daily limit. The options cover the three variations that cause most confusion in practice: padding, the URL-safe alphabet, and the 76-character line wrapping used by email.
What Base64 does to text
Base64 is a reversible encoding, not a cipher. It takes every three bytes of input and writes them as four characters from a 64-character alphabet: A–Z, a–z, 0–9, + and /. Three bytes hold 24 bits, and four Base64 characters hold the same 24 bits in groups of six. Nothing is added or removed, apart from padding at the end.
Text is not stored as bytes in JavaScript, so the page encodes the UTF-8 form of what you typed. A character such as é takes two bytes, 東 takes three and 👋 takes four. That is why the byte count in the stats can be larger than the number of characters you see. The encoding is correct as long as the other end also treats the bytes as UTF-8, which is the default almost everywhere today.
The output grows by about a third. Three bytes become four characters, so the encoded string is 4/3 of the input, plus a little for padding and line breaks. Base64 is a transport format, not a way to save space.
A worked example
The sample text was ToolsHub4u — free tools, café, 東京 and 👋. With padding on and the standard alphabet, the page reported 49 UTF-8 bytes and 68 Base64 characters, a 39% increase. The first part of the result is shown below.
| Input | Setting | Result |
|---|---|---|
| Sample sentence | Encode, standard, padded | VG9vbHNIdWI0dSDigJQgZnJlZSB0b29scywgY2Fmw6ksIOadseS6rCBhbmQg8J+Riw== |
SGVsbG8sIHdvcmxkIQ== | Decode, standard | Hello, world! (13 bytes, 13 characters) |
ÿþ | Encode, URL-safe, padded | w7_Dvg== |
The third row shows the difference between the alphabets. The standard output for those four UTF-8 bytes would contain a /; the URL-safe option writes _ instead. The two strings are not interchangeable unless the decoder knows which alphabet was used.
A longer input produced 180 Base64 characters from 135 bytes, split into three lines of 76, 76 and 28 characters when wrapping was on. The line breaks are formatting only. They are legal in a MIME body but not inside a JSON string, so leave wrapping off when the value goes into JSON.
Padding, URL-safe output and wrapping
Padding is the = at the end. One = means the last group held two bytes and two = means it held one. The pads let a decoder know how many bits to discard. They are optional in many contexts because the length gives the same information, and the URL-safe variant usually drops them. This page keeps them when Include = padding is ticked, which is the safer default for email and most APIs.
The URL-safe option follows the alphabet in section 5 of RFC 4648: + becomes - and / becomes _. Use it for query strings, filenames and JSON Web Tokens. A + in a query string is often decoded as a space, and a / can be read as a path separator, so the standard alphabet needs percent-encoding in those places.
Wrapping inserts a line break every 76 characters. That number comes from MIME, the email format in RFC 2045, which needed short lines for old mail transport. It is not part of Base64 itself. If a system rejects your value for containing line breaks, turn wrapping off rather than stripping the breaks by hand.
When decoding fails
The decoder is strict about the alphabet, which is the behaviour RFC 4648 recommends. A string containing a space, an @, or a character from the other alphabet stops with That is not valid Base64. Common causes are a copied prefix such as data:image/png;base64,, a missing character at the end, or a value that was URL-safe on the way in.
The page decodes to text, not to files. If the bytes are a PNG, a PDF or another binary format, the result will usually fail because those bytes are not valid UTF-8. Base64 of a binary file needs a decoder that writes a file, not one that writes characters. That is a deliberate boundary, not a bug.
Uploads are read in the browser and are capped at 5 MB. For a larger file, use a command-line tool: base64 -w 0 file.bin on Linux or macOS, or [Convert]::ToBase64String() in PowerShell. Those tools also avoid the copy-and-paste step that tends to add a stray newline.
What Base64 is not
It is not encryption. Anyone with the string and a decoder gets the original bytes back; there is no key. If the text is a password, a token or private data, encode it only after encrypting it, or better, do not put it in a URL at all. The hash generator is for fingerprints, not for hiding data, and hashing is also not encryption.
It is not compression, and it is not a character set. Base64 moves bytes; the question of whether those bytes are UTF-8, Latin-1 or a JPEG is decided before encoding and after decoding. That is why a Base64 string that looks fine can still decode to mojibake: the bytes were never UTF-8 to begin with.
If you are checking a value inside a larger JSON document, paste it into the JSON formatter first. A wrapped Base64 value with real line breaks is not valid JSON, and the formatter will point at the line where the string broke rather than at the encoding.