Base64 Encoder / Decoder

Encode text and files to Base64 and decode back, with UTF-8 support. Handles line breaks, missing trailing equals signs, the URL-safe variant and data: prefixes.

0 characters ยท 0 bytes

Or drag a file here or click to choose. Up to 50 MB, the file is not sent to a server

What the tool does

Base64 writes any bytes with 64 characters: letters, digits, "+" and "/". This is how a binary file or text in a non-Latin alphabet travels where a plain string is expected: inside JSON, in an email, in an image URL within CSS.

Text is first converted to UTF-8 bytes and only then to Base64. Cyrillic, symbols and emoji come back character for character.

What counts as input

A Base64 string rarely arrives clean, so the tool tolerates line breaks and spaces inside it, a string without the trailing "=" padding, the URL-safe variant with "-" and "_", and a data:โ€ฆ;base64, prefix.

If the string is broken, you don't get an empty field. The tool points to the break: the line and column where an invalid character appeared.

Files

You can drag a file onto the page or pick one with a button. Its bytes are encoded to Base64; the result can be copied or downloaded as a .txt file. In the other direction, the tool accepts a file containing a Base64 string. A file is encoded up to 50 MB, and a Base64 string inside a file is read up to 70 MB.

The decoded result is not always text

A Base64 string often holds an image or a PDF. When the bytes don't add up to valid UTF-8 text, the tool names the file type, its size and the first bytes in hexadecimal. No garbled characters instead of a picture. The file itself can be downloaded, with the extension chosen by its content.

Rate this tool

Help us get better

Other tools