Skip to main content
TestrHub home
Menu

Base64 Encoder/Decoder

Encode and decode Base64 for text and files, with accents, URL-safe Base64 and clear errors. Decoded files are recognised. Nothing is uploaded.

Runs in your browser. Nothing is uploaded.

Encoded and decoded in your browser as you type: nothing is uploaded, saved or added to the address.

Accents and emoji are encoded as UTF-8, the way the web expects: é becomes w6k=.

Nothing is kept

No history, no link, no upload: what you type or open stays on this page until you close it.

Results

What Base64 is

Base64 writes any data, text or files, with only 64 safe characters: letters, digits, + and /. It lets binary data travel where only plain text is allowed: in emails, in web addresses, inside JSON or HTML, or in a data URL that embeds a small image directly in a page. It is not encryption: anyone can decode it.

The result is about a third longer than the original, because every 3 bytes become 4 characters.

How to use it

  • Encode: type or paste text, or open a file, and the Base64 appears below as you type.
  • Decode: paste Base64 or a data URL. Text appears below; a file is offered for download, with a preview if it is an image.
  • Swap moves the result to the input and switches direction, to check a round trip.

Everything happens in your browser: nothing is uploaded, saved or added to the page address.

The Base64 encoder and decoder encoding the example text Café crème, ça va ? with a thumbs-up emoji: the Encode, Decode and Swap buttons, the text, the URL-safe and email line options, the sizes, and the Base64 result with Copy and Download.

On the screenshot, with an example:

  1. Choose to encode or decode, or swap.
  2. The text to encode, accents and emoji included.
  3. The options: URL-safe Base64 and email line lengths.
  4. The Base64 result, ready to copy or download.

URL-safe Base64 and line breaks

  • URL-safe Base64 replaces + and / with - and _, and drops the = at the end, so the result can go in a web address or a file name without being altered. Web tokens such as JWTs use it. When decoding, the tool accepts both forms automatically.
  • Lines of 76 characters are what email attachments use (MIME). Leave this off everywhere else.

Accents and emoji

Base64 encodes bytes, so text must first become bytes. This tool uses UTF-8, the encoding of the web: “é” becomes the two bytes C3 A9, which encode as w6k=. Some older tools use another encoding and give a different result, which then decodes into garbled characters such as “é”.

Files and data URLs

Open a file to get its Base64, or copy it as a data URL, such as data:image/png;base64,iVBORw0…, ready to paste into HTML or CSS. Small images only: a data URL is a third larger than the file and cannot be cached separately.

When decoding gives a file rather than text, the tool says so, recognises common types (PNG, JPEG, GIF, WebP, SVG, PDF, ZIP, MP3…) from their first bytes, and offers the right download.

When decoding fails

  • A character that is not Base64, such as a space inside a word, a quote or a symbol: the tool shows which one and where, and can remove all of them at once. This often happens when copying from an email or a document.
  • Characters after an =: the = may only appear at the end. Two Base64 texts were probably joined.
  • A length that does not fit: a character is missing or extra, usually because the copy was incomplete.
  • A missing = at the end is not an error: many encoders leave it out, and the tool adds it and says so.

Frequently asked questions

Is Base64 a way to hide or protect data?

No. It only changes how data is written, and anyone can decode it. To protect data, it must be encrypted.

Why does my decoded text look garbled?

Either it was encoded with another character encoding than UTF-8, or it is not text at all but a file. The tool tells you when it decodes to a file.

Is anything I paste sent anywhere?

No. Encoding and decoding run in your browser, and nothing is kept once you close the page.

Last updated: November 7, 2026

Guides about this test