Base64 Encoder and Decoder

Encode text or files to Base64 and decode Base64 back to text, with full Unicode support and a URL-safe option, right in your browser.

Text
Base64

Your text and files never leave your device. Encoding and decoding happen in this browser tab.

What Base64 is

Base64 is a way of writing any binary data, such as an image, a PDF or a piece of text in any language, using only 64 safe characters: the capital letters A to Z, the small letters a to z, the digits 0 to 9, and the symbols + and /. The equals sign = is added at the end as padding. Because those characters survive email systems, JSON, XML, URLs and copy and paste without being changed, Base64 is the standard way to carry bytes through channels that were designed for plain text. It is defined in RFC 4648.

When you need it

How it works

The encoder takes your data three bytes at a time. Three bytes are 24 bits, which it splits into four groups of 6 bits. Each 6 bit group is a number from 0 to 63, and that number picks one character from the 64 character alphabet. So every 3 bytes become 4 characters, and the encoded text is always about 33 percent larger than the original. When the data does not divide evenly into groups of three, the last group is padded with one or two = signs.

Text has to become bytes first. This tool converts your text to UTF-8 with the browser's TextEncoder, so Hindi, emoji, accented letters and Chinese all round-trip exactly. The common shortcut of calling btoa() directly on a string fails on any character outside Latin-1, and that is the usual reason other converters show an error on a rupee sign or an emoji.

A worked example

The word "Man" is the bytes 77, 97 and 110, or 01001101 01100001 01101110 in binary. Regrouped into 6 bits that is 010011 010110 000101 101110, the numbers 19, 22, 5 and 46, which are the characters T, W, F and u. So "Man" encodes to TWFu. The single letter "é" is two bytes in UTF-8, so it becomes w6k=, with one padding sign.

URL-safe Base64

The characters + and / have special meanings in URLs and file names. The URL-safe variant from the same RFC swaps them for - and _ and usually drops the padding. JSON Web Tokens use it. The decoder here accepts both alphabets, with or without padding, and ignores spaces and line breaks, so you can paste wrapped output from an email.

Errors and binary data

If decoding fails, the tool tells you why: a character that is not part of Base64 and its position, a length that cannot be complete, or padding in the wrong place. If the input is valid but turns out to be an image or another binary file rather than text, it says so, and Download saves the decoded bytes as a file. Files up to 10 MB can be encoded.

Base64 is not encryption

Anyone can decode Base64 instantly, so never use it to hide a password or personal data. Everything on this page runs in your browser, and nothing you paste or open is sent to Ur Next Door.

Frequently Asked Questions

Why does Base64 make my data bigger?
Every 3 bytes of input become 4 Base64 characters, so the encoded text is about 33 percent larger than the original, plus up to two = signs of padding at the end.
Can it encode Hindi text and emoji?
Yes. Text is turned into UTF-8 bytes before encoding, so Hindi, emoji, the rupee sign and every other character round-trip exactly. Decoding turns the bytes back into the same text.
What is URL-safe Base64?
It is the variant from RFC 4648 that uses - and _ instead of + and /, and usually leaves out the = padding, so the result can go into a URL or a file name. JSON Web Tokens use it. The decoder accepts both forms.
Why do I get an error when decoding?
The message says what is wrong: a character that is not part of Base64 and its position, a length that cannot be complete, or padding in the wrong place. If the data is valid but is a file rather than text, you can download it.
Is Base64 a form of encryption?
No. Anyone can decode it in a second, so it does not protect secrets. It only makes binary data safe to send through systems built for text.
Are my files uploaded?
No. Files are read by your browser on your own device and turned into Base64 there. Nothing is sent to Ur Next Door.