Base64 Decoder
Decode a Base64 string and view the resulting text. Paste encoded content into the Base64 String field to see the decoded output.
Base64 to Text Decoder Tool
Base64 Decoder Formula
Where:
- \(v_1,v_2,v_3,v_4\) — the values, from 0 to 63, represented by four Base64 characters.
- \(b_1,b_2,b_3\) — the three decoded bytes, each from 0 to 255.
Each complete group of four Base64 characters represents three bytes. The equations recover those bytes by reversing the way Base64 divides them into six-bit values; a final group with padding produces fewer bytes.
Base64 Decoder – Calculation Example
Example: the default Base64 String, SGVsbG8gd29ybGQh, contains the encoded message “Hello world!”.
\[ \operatorname{atob}(\texttt{SGVsbG8gd29ybGQh})=\text{Hello world!} \]
Result: the Decoded Text is Hello world!.
How to use the Base64 Decoder
- Paste or type your encoded content into the Base64 String field. You can leave the default value in place to try the example above.
- Read the Decoded Text result. For the default input, it displays
Hello world!. - Use the result’s copy control if you need to paste the decoded text elsewhere. If the result says “Invalid Base64 string,” check the input for characters that do not belong in standard Base64.
The calculator trims whitespace from the beginning and end of your input before decoding. You can paste a complete string without adding quotation marks or a label such as base64:; those extra characters would become part of the input.
What Base64 decoding means
Base64 is a way to represent bytes using a limited set of text characters: letters, digits, +, and /, with = sometimes used as padding at the end. It is often used when data needs to pass through a text-based format, such as an API response or an email message. Decoding reverses that representation; it does not decrypt the data or change what the original bytes mean.
This calculator uses the browser’s atob() function. Its output is a string in which each character represents one decoded byte. Ordinary ASCII text, including the default example, therefore appears as expected. If the original data was a file, compressed data, or another non-text format, the result may contain unreadable characters rather than useful prose.
For text outside ASCII, the distinction between bytes and characters matters. UTF-8 uses multiple bytes for many accented letters, symbols, and emoji, but this tool does not perform a separate UTF-8 conversion after Base64 decoding. A valid Base64 string containing UTF-8 text can consequently produce garbled-looking output. That appearance does not necessarily mean the Base64 itself is invalid.
Input limits and practical tips
This tool expects Base64 that the browser’s atob() function accepts. Standard Base64 commonly ends in one or two = padding characters, although the browser may also accept a valid final group without padding. Missing padding alone is not a reliable sign of an error. If decoding fails, check for copied punctuation, an incomplete string, or characters from a different encoding format.
URL-safe Base64 commonly substitutes - for + and _ for /. This calculator does not convert those characters automatically. If your source explicitly uses URL-safe Base64, make those substitutions before entering it. Likewise, if the encoded value is embedded in a URL, first extract the Base64 portion; use the URL Decoder when the URL itself contains percent-encoded characters.
If you need to turn text into Base64 rather than decode it, use the Base64 Encoder. To inspect byte values in a different notation, the Hex Converter and Binary Converter cover those representations. None of these conversions makes sensitive content private: Base64 is an encoding, not a security measure.
Frequently Asked Questions
How can I decode Base64 by hand?
Look up each character’s value in the Base64 alphabet, then write each value as six binary bits. Join the bits and split them into eight-bit bytes. For example, TQ== contains the values 19 and 16, giving the bits 01001101—a byte with the ASCII value for M. The two = signs indicate that the final group contains only one byte.
How many bytes will a Base64 string produce?
For a padded string, count the characters, divide by four, multiply by three, then subtract the number of = signs at the end. For example, eight characters ending in one = represent five bytes. This counts bytes, not displayed characters: a UTF-8 character may occupy several bytes, and binary data may not display as readable text.
Do spaces or line breaks make Base64 invalid?
The browser’s Base64 decoder generally ignores ASCII whitespace, including spaces, tabs, and line breaks, even within the encoded string. Other invisible characters copied from a document may still cause an error. If an input fails unexpectedly, try removing formatting and checking for look-alike characters, such as a typographic dash in place of a regular hyphen.
How do I recover accented letters or emoji from decoded Base64?
First decode the Base64 into bytes, then interpret those bytes using the text encoding used by the source—usually UTF-8. This calculator displays each byte as a character instead of performing that second step. In JavaScript, you can pass the decoded byte values to TextDecoder with UTF-8. If the source used another character encoding, select that encoding instead.
Can I paste an entire data URL into the decoder?
No. For a data URL such as data:text/plain;base64,SGk=, paste only the portion after the comma: SGk=. The prefix describes the content and is not part of the Base64 data. Also check that the URL actually contains ;base64; some data URLs store text using percent-encoding instead.
Why does a successfully decoded result contain strange symbols or blank characters?
Successful Base64 decoding only confirms that bytes were recovered; it does not guarantee that those bytes form readable text. A decoded file may contain control bytes, including a zero byte, that appear blank or behave oddly when copied. To inspect such content reliably, use a byte-oriented tool, such as a hex viewer, rather than a text display.
How does Base64 differ from hexadecimal encoding?
Both represent bytes as text without encrypting them. Hexadecimal uses two characters per byte and is convenient for inspecting individual byte values. Base64 packs the same data more compactly: a full group of three bytes becomes four characters, excluding any line breaks or surrounding format. Choose the format required by the system receiving the data.
One thought on “Base64 Decoder”