Base64 Encoder & Decoder

Turn text into Base64 or decode it back, with correct UTF-8 handling for accents and emoji. Everything happens on your device.

Runs in your browser — nothing is uploaded

Base64

About the Base64 Encoder & Decoder

Base64 represents binary data as 64 printable ASCII characters. It is used to embed images in CSS and HTML, to carry credentials in HTTP Basic authentication headers, and to put binary payloads into JSON or email bodies that only accept text.

Plain Base64 works on bytes, not characters, so text with accents, Chinese characters or emoji must be converted to UTF-8 first. This tool does that conversion for you, and it reports an error when a Base64 string decodes to bytes that are not valid UTF-8 instead of showing garbled text.

URL-safe Base64 replaces + with - and / with _ so the value can sit in a URL or a filename without escaping. The decoder accepts both alphabets and fills in missing = padding, so you can paste a token straight from a query string.

FAQ

Base64 Encoder & Decoder — frequently asked

Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse without a key, so it provides no confidentiality. It only changes how bytes are written as text. If you need secrecy, encrypt the data first with a method such as AES-GCM and then Base64-encode the result for transport.

Why does decoding show an error for some strings?

Base64 input must contain only the 64 standard or URL-safe characters, and its length must work out to a valid group of four. A stray character or a truncated copy will fail. The decoder also checks that the decoded bytes are valid UTF-8; if you decoded a binary file such as a PNG, the bytes are not text and no readable output exists.

Does this tool upload my text?

No. Encoding and decoding use the browser’s built-in btoa, atob and TextEncoder functions. The page makes no network request with your input, so API keys or customer data you paste stay on your machine.

How much larger is Base64 output?

Every three input bytes become four Base64 characters, so the output is about 33% longer than the input, plus padding. Compressing data before encoding reduces the overhead, which is why JWT payloads and inline images are often compressed or kept small.

What is the difference between Base64 and Base64URL?

Base64URL uses - instead of + and _ instead of /, and usually omits the = padding. It is the variant used in JWTs and many OAuth tokens because those characters are safe inside URLs and file names. Both variants decode to the same bytes once converted back.

Can I encode a file with this tool?

This tool works on text. For a file, read its bytes and Base64-encode them in code, for example with btoa over a binary string or Buffer.from(file).toString('base64') in Node.js. Pasting a very large file into a text box is slow and is not recommended.

    Report an issue