← All tools

Base64 converter

Encode text or files and decode Base64 into the original bytes.

Encode and decode Base64

Convert UTF-8 text or file bytes to Base64, or decode Base64 to the original bytes. Everything runs in this browser.

File or UTF-8 input: up to 2 MiB. Base64 input: up to 4 MiB including whitespace; decoded output: up to 2 MiB. Preview: 8,000 characters.

Standard output uses required = padding; URL-safe output has no padding. Standard decoding requires the required padding. URL-safe decoding accepts correctly padded or unpadded input. Mixed alphabets, data: prefixes, invalid padding and nonzero unused bits are rejected. Base64 is encoding, not encryption.

Files are encoded byte for byte, including BOMs and line endings. Pasted text uses the current browser text value encoded as UTF-8; earlier encoding or CRLF bytes may already have changed. Decoded .bin downloads preserve all bytes, including BOMs and line endings. Previewed HTML/SVG is plain text and never rendered.

Choose a file or enter text, select a conversion, then press Convert.

Worked example

Encode Hello and restore the original bytes

Enter only the five letters Hello, without spaces or a newline. This short round trip distinguishes encoded text from a decoded file.

Example input

Hello
  1. Choose Base64 encoding and the standard alphabet. Convert and check for SGVsbG8=.
  2. Paste SGVsbG8= into the input, select decoding and keep the standard alphabet, then convert again.
  3. Check Hello in the text preview. The .bin download contains those five original bytes; the extension does not change their content.

What to check in the result

The encoded result is shown below. URL-safe output omits the final = and becomes SGVsbG8. Base64 encodes data; it does not encrypt or hide it.

SGVsbG8=

Troubleshooting

Why won’t a copied string decode?
Select the standard or URL-safe alphabet to match the input. Remove a data: prefix, and retain required padding for standard Base64. If line breaks are the issue, enable ASCII whitespace ignoring; do not arbitrarily delete other invalid characters.
Why is there no text preview after decoding?
The output may be an image or other bytes that are not valid UTF-8. For example, /w== decodes to the single byte FF. Download the .bin and inspect it with an application for the known original format. Missing text does not itself mean conversion failed.