How to use a base64 calculator
A Base64 calculator does in one click what takes several minutes by hand, but it only helps if you feed it the right input and read the right output. This guide walks through encoding and decoding step by step, shows the checks that catch a broken string before you use it, and explains the options you will meet along the way. Open the Base64 Encoder Decoder and follow along: everything below uses it as the example.
Encoding in four steps
First, type or paste your text into the input box. It can be a single word, a sentence or a whole paragraph; the calculator reads it as UTF-8, so non-English text and emoji work as well as plain English. Second, pick Encode rather than Decode — the two directions look alike, and picking the wrong one is the commonest slip. Third, read the result: WhiteUI, which is 7 bytes, encodes to V2hpdGVVSQ==, which is 12 characters with two equals signs at the end. Fourth, copy the whole result, equals signs included, because a missing = at the end will make the string fail to decode later. That is the whole process, and it takes seconds.
Decoding in four steps
Decoding is the same process in reverse. First, paste the encoded string into the input box, taking care to copy it exactly — every letter, in the right case, with the equals signs at the end. Second, pick Decode. Third, read the result: V2hpdGVVSQ== decodes to WhiteUI, and SGVsbG8= decodes to Hello. Fourth, check the result makes sense: if it is readable text, the decode worked; if it is gibberish, the string was probably copied wrongly, encoded twice, or was never Base64 in the first place. A quick test is to encode the decoded result again: WhiteUI should give you back exactly V2hpdGVVSQ==, character for character.
Checks that catch a broken string
Run three checks before you trust an encoded string. First, the length must be a multiple of four: SGVsbG8= is 8 characters, V2hpdGVVSQ== is 12, and aGVsbG8gd29ybGQ= is 16. A length of 7, 11 or 15 means a character is missing. Second, equals signs may only appear at the very end, one or two of them, never in the middle. Third, every character must belong to the alphabet: capital and small letters, digits, plus, slash and equals. A percent sign, a space or a hyphen in a standard Base64 string means something went wrong — a hyphen belongs to the URL-safe variant, and a percent sign belongs to URL encoding. If a string fails any of these checks, do not guess; go back to the source and copy it again.
Long strings and line breaks
Long encoded strings are often wrapped across lines, because the email standard limits lines to 76 characters: 57 bytes of input make exactly one line of 76 characters, and longer input wraps onto the next line. The line breaks are not part of the data, and most decoders ignore them, but some do not, so the safest habit is to remove line breaks before decoding, or to use a tool that does it for you. The same applies to spaces: an encoded string should contain no spaces at all, and a space in the middle usually means the string was wrapped or broken while copying. If your decode fails on a long string, strip the line breaks and spaces first, then try again.
Options you will meet
Most calculators offer a few choices, and they are worth understanding. The URL-safe option swaps plus for a minus and slash for an underscore, so the result can go into a web address without breaking it; use it whenever the output will appear in an address, and the standard alphabet everywhere else. The line-wrap option breaks long output into 76-character lines, which email systems expect; leave it off unless you are preparing an email attachment. And the empty input case is worth knowing: encoding nothing gives nothing back, an empty string, which is correct, because zero bytes need zero characters. None of these options changes the data itself; they only change how it is presented, so pick the presentation that matches where the result is going.
Frequently asked questions
How do I encode text in Base64?
Type the text, pick Encode, and copy the whole result including the = signs. WhiteUI encodes to V2hpdGVVSQ==.
How do I decode a Base64 string?
Paste the string exactly, pick Decode, and check the result makes sense. V2hpdGVVSQ== decodes to WhiteUI.
Why does my Base64 string fail to decode?
Check three things: the length is a multiple of four, = signs appear only at the end, and every character is in the alphabet. A missing = is the usual cause.
What do I do with line breaks in a long Base64 string?
Remove them before decoding. Email wraps Base64 at 76 characters per line, and the breaks are not part of the data.
More guides on the Base64 Encoder Decoder
Try the Base64 Encoder Decoder — free, in your browser.