Base64 encoder and decoder

Encode and decode Base64 for text and files, standard or URL-safe, with correct UTF-8. Nothing leaves your browser.

Everything happens on your device. What you type never leaves it.

or drop a file here. Limit 10 MB.
Mode
Alphabet
Padding

This tool needs JavaScript to run

About this tool

Base64 writes any data, text or a whole file, using only letters, digits and a few symbols, so it can travel through places that only accept plain text: email, JSON, URLs and configuration files. This tool converts in both directions. Choose Encode or Decode, paste your text, and the result appears as you type.

Text is converted as UTF-8, so accented letters, other alphabets and emoji survive a round trip. Choose the URL-safe alphabet to get the variant that uses - and _ instead of + and /, and switch the padding off to leave out the = characters at the end. When you decode, spaces and line breaks are ignored, and missing padding is accepted.

You can also encode a file of up to 10 MB: choose it or drop it on the page. If the decoded bytes are not text, such as an image, the tool says so and offers a download instead of showing garbage. If the input is not valid Base64, you are told which character is wrong and where.

Everything happens on your device. What you paste, and every file you choose, is read by code running in your browser and is never sent to a server.

Examples

Encode a sentence

Input

Hello, world

Output

SGVsbG8sIHdvcmxk

Encode text with accents and emoji

Input

héllo 😀

Output

aMOpbGxvIPCfmIA=

Decode a value

Input

QmFzZTY0IGlzIG5vdCBlbmNyeXB0aW9u

Output

Base64 is not encryption

Common questions

Is what I paste, or the file I choose, uploaded anywhere?

No. The text and files are read and converted by code running in your browser. Nothing is sent to ajx.io or to anyone else, and the tool keeps working if you go offline.

Is Base64 a way to keep something secret?

No. Base64 is an encoding, not encryption. Anyone can decode it in a second, so never use it to protect a password or a token.

What is the URL-safe alphabet?

Standard Base64 uses + and /, which have special meanings in addresses. The URL-safe variant uses - and _ instead, so the result can sit in a link or a file name. Choose the alphabet that matches the text you are decoding.

Why does decoding say a character is wrong?

Base64 text may only contain letters, digits, two symbols that depend on the alphabet, and = at the end. The message names the first character that does not belong and its position, so you can find a stray quote, a space inside a word, or a character from the other alphabet.

Why does it offer a download instead of showing the result?

If the decoded bytes are not valid text, for example a picture or a compressed file, showing them would only produce unreadable symbols. Download saves the exact bytes.

How large a file can I encode?

Up to 10 MB. The file is read in pieces by a background process, with a progress bar and a Cancel button, so the page stays responsive.