Base64 Encode / Decode
Type or paste text to get its Base64 form, or switch to Decode and paste Base64 to read what it says. Everything runs in your browser and updates as you type.
Base64
Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide a password or private data.
This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.
What this Base64 converter is for
Base64 is a way of writing any data using only 64 plain characters: the capital letters, the small letters, the ten digits and two symbols. It exists because many older systems, such as email bodies, web addresses and config files, were built to carry simple text and can mangle anything else. Rewriting the data as letters and digits lets it pass through untouched, and the receiver turns it back at the other end.
This page does both directions. Encode text turns what you type into Base64, and Decode Base64 turns a Base64 string back into text you can read. You will meet Base64 in data links inside web pages, in email attachments, in API keys and tokens, and in computer science lessons about how text is stored.
Base64 is not a secret code. There is no key and no password, so anyone who sees the string can decode it in a second. Use real encryption when something has to stay private.
How to encode or decode in a few steps
- Pick a Direction: Encode text or Decode Base64.
- Type or paste into the big box. The result appears in the yellow panel straight away.
- When encoding, choose the Alphabet, whether to add Padding, and the Line length. The defaults suit most jobs.
- Press Copy result to put the answer on your clipboard.
- Use result as input moves the answer into the box and flips the direction, which is a quick way to check a round trip. Reset brings back the starting example.
The rows under the buttons show the sizes, how many padding signs were used and the raw bytes written in hex.
Worked example: encoding the word Man
Type Man with the direction on Encode text. The answer is TWFu. Here is why.
- The three letters are stored as the bytes 77, 97 and 110. In binary that is
01001101 01100001 01101110. - Join the 24 bits and cut them into four groups of six:
010011 010110 000101 101110. - Those groups are the numbers 19, 22, 5 and 46.
- Look each number up in the Base64 alphabet, where A is 0: 19 is T, 22 is W, 5 is F and 46 is u.
Three bytes always become four characters, so the output is about one third longer than the input. The starting example shows the same thing on a bigger scale: Hello, World! is 13 bytes and encodes to the 20 characters SGVsbG8sIFdvcmxkIQ==, which is 153.8% of the original size.
Why some results end in equals signs
The method works on blocks of three bytes. When the data does not divide evenly by three, the last block is short, and the encoder fills the gap with = signs so the output length is still a multiple of four.
| Input | Bytes | Base64 | Padding |
|---|---|---|---|
| Man | 3 | TWFu | none |
| Ma | 2 | TWE= | one sign |
| M | 1 | TQ== | two signs |
| Hello | 5 | SGVsbG8= | one sign |
Some systems drop the padding because the length can be worked out without it. Choose No padding to get TQ instead of TQ==. When decoding, this tool accepts input with or without the signs.
Standard and URL-safe alphabets, and line wrapping
The standard alphabet uses + and / as its last two characters. Both have special jobs inside a web address, so a second alphabet swaps them for - and _. The text ??? encodes to Pz8/ in the standard alphabet and Pz8_ in the URL-safe one. Both alphabets, the padding rules and the name base64url for the second form are set out in RFC 4648, the internet standard for these encodings (read December 2026).
The same document notes that MIME, the format used for email, limits Base64 lines to 76 characters. Choose Wrap at 76 characters if the place you are pasting into expects that layout. For anything else, one long line is the safer choice. If you need to make ordinary text safe for a link instead, the URL encoder and decoder is the right tool.
Accents, emoji and other characters beyond plain English
Base64 works on bytes, not letters, so the text first has to be turned into bytes. This tool uses UTF-8, the usual choice on the web. A plain English letter is one byte, but other characters take more. The word café has four characters and five bytes, and encodes to Y2Fmw6k=. A single smiling-face emoji is four bytes and becomes 8J+YgA==.
When you decode, the bytes are read as UTF-8 again. If they do not form valid text, the tool says so and shows the bytes as hex pairs instead of printing nonsense. That usually means the Base64 holds an image, a zip file or something else that was never text. To see the number behind each ordinary character, try the ASCII table and converter, and for the ones and zeros themselves use the binary converter.
Common mistakes and limits
- Treating it as security. Encoding hides nothing. If you need a fingerprint of some text that cannot be reversed, that is a job for the hash generator.
- Copying only part of the string. A missing character at the end gives the message that the Base64 looks cut off. Copy the whole thing, including any equals signs.
- Stray characters. Spaces and line breaks are ignored, but a comma, a quote mark or a star is not Base64 and stops the decode. The message tells you the position.
- Mixing up the alphabets. A string with
-or_is URL-safe Base64. This decoder reads both kinds and tells you which one it found. - Files. This page converts text. It does not upload or encode images and documents, and the input is limited to 100,000 characters.
Handy uses for class and for projects
In a computing lesson, have students encode their first name by hand using the six-bit method above, then check it here. Changing one letter and watching which output characters change is a clear way to show how the bits are shared between neighbors. For web projects, decode the middle part of a token or a data link to see what it carries, and paste any JSON you find into the JSON formatter to make it readable.
You will find more encoders and converters with the other tech and web tools, and the whole collection of free online tools is listed on the main tools page.
Frequently asked questions
Is Base64 a form of encryption?
No. Base64 is an encoding with no key or password, so anyone can turn it back into the original data. It is meant for carrying data safely through text-only systems, not for keeping secrets.
What is Hello in Base64?
Hello encodes to SGVsbG8= in standard Base64. The single equals sign is padding, because Hello is 5 bytes and the last block of three is one byte short.
Why does Base64 end with one or two equals signs?
Base64 turns every 3 bytes into 4 characters. When the last block has only 2 bytes, one equals sign is added, and when it has 1 byte, two are added, so the length stays a multiple of four.
How much bigger does Base64 make my data?
About one third bigger, because 3 bytes become 4 characters. For example, the 13 bytes of Hello, World! become 20 characters with padding.
What is URL-safe Base64?
It is the same encoding with two characters swapped: a minus sign replaces the plus sign and an underscore replaces the slash. That keeps the result from clashing with characters that have special meaning in web addresses.
Why does my decoded Base64 show hex instead of text?
The decoded bytes are not valid UTF-8 text. The Base64 most likely holds a file such as an image, so the tool shows the raw bytes as hex pairs instead.
