🔒 Processed locally in your browser — no data uploaded
← Back to Home

Base64 Encoder / Decoder

Input text
Result

What the Base64 Encoder / Decoder does

The page converts text to Base64 and Base64 back to text through UTF-8, so accented letters, Chinese characters and emoji survive the round trip without turning into question marks. Paste text and press Encode to get the Base64 string, or paste a Base64 string and press Decode to read it back. Encoding the sample already sitting in the box, Hello, 世界!, produces SGVsbG8sIOS4lueVjO+8gQ==.

Base64 appears wherever data has to travel through a channel that only tolerates plain text: HTTP Basic authorization headers, data URIs in HTML and CSS, email attachments, JSON and XML fields, and the segments of a JSON web token. The usual reason to open a converter like this is to see what a value someone sent you really says, or to make a block of bytes safe to paste into a config file.

How to use it

  1. Paste your textType or paste into the single input box. Because encoding and decoding share that box, whatever is already in it gets read in whichever direction you run next.
  2. Press EncodeThe button reads the box as UTF-8 text and writes standard Base64 into the result area below. Spaces at the ends of your input count as characters, so trim accidental ones first if they were not meant to be there.
  3. Or press DecodeDecoding treats the box contents as Base64 and writes the recovered text back out. Whitespace around the string is trimmed for you, but line breaks inside the string are not tolerated.
  4. Copy the resultThe output is plain selectable text with no copy button and no download step. Select and copy it, then press the clear button when you are finished with anything confidential.

Options and formats

Encode directionA one-way conversion from text to Base64 with standard padding and no line wrapping. The result arrives as a single unbroken line, which is what HTTP headers and JSON values expect.
Decode directionThe reverse conversion from Base64 to text. It expects the standard alphabet, correct padding and no internal whitespace, and it reports a failure rather than guessing when the input does not qualify.
Shared input boxThere are no separate source and target fields, so the input area is also where the previous result went. Copy anything you want to keep before running the opposite direction over it.
Character counterAfter each run the line under the result reports how many characters came out, which shows how much the encoded form grew compared with the text you started from.
Clear buttonWipes the input, the result and the counter together. Nothing was stored anywhere while you worked, but clearing takes the value off the visible page and out of the clipboard's reach.

Things to watch out for

Whitespace inside the stringBase64 copied from a wrapped source, such as a certificate block or a quoted email header, contains line breaks the decoder rejects. The ends are trimmed for you and the middle is not, so join the lines into one string first.
Not everything decodes to textBase64 that came from an image, a compressed archive or encrypted bytes is not valid UTF-8, so the decode either fails or returns unreadable characters. This is a text converter, not a decoder for files or binary payloads.
URL-safe alphabetSegments of a JSON web token and many query string values use dash and underscore in place of plus and slash, and they often drop the trailing padding. Swap the characters and restore the equals signs before decoding them here.
Encoding twice by accidentPressing Encode on a result that is already Base64 nests the conversion, and the output still looks plausible, only longer. The character counter is the clue, since the length should have grown by about a third, not doubled.

Frequently asked questions

Is Base64 a form of encryption?

No. It is a reversible encoding that needs no key, and anyone can turn a string back into readable text in one step. That is why credentials hidden in Base64 still count as exposed. Use it to move data through text-only channels, not to protect anything.

Why does decoding give me strange symbols?

The encoded bytes were never text, or they are text in an encoding other than UTF-8. The tool recovers characters rather than files, so an image or archive has to be decoded by a program that can write binary output instead.

Does it handle emoji and non-Latin scripts?

Yes. The conversion passes through UTF-8 before Base64 is applied, which is the step a plain browser encode usually skips and the reason so many converters mangle non-English text. Latin accents, Chinese, Japanese, Arabic, Cyrillic and emoji all survive a full encode followed by a decode.

Why does my JSON web token refuse to decode?

Tokens use the URL-safe alphabet and usually drop padding, and only the middle segment holds the readable payload. Swap the dash and underscore characters, restore the equals signs, and decode one segment at a time rather than pasting the whole token into the box.

Can I turn a Base64 string back into an image file?

Not with this page. The result is displayed as text, so decoded image bytes show up as unreadable characters rather than a picture. Use a data URI in a browser or a decoder that writes files when you need the original bytes back.

How much longer is the encoded text?

Base64 represents every three bytes of input as four characters, so the output runs roughly a third longer than the original, plus a little padding at the end. The counter beneath the result gives the exact figure for whatever you pasted in.