About the Base64 Decoder
Base64 strings turn up in email sources, API responses, configuration files, tokens and data URLs, and they are unreadable until decoded. This tool will base64 decode any string back into text, treating the result as UTF-8 so accented letters, non-Latin scripts and emoji come back exactly as they went in: SGVsbG8= becomes Hello. Missing padding is restored automatically and stray spaces or line breaks are ignored, while genuinely invalid input gets a plain-language error instead of garbled output. Decoding happens in your browser, which matters for strings containing private data, and both standard and URL-safe alphabets are accepted. To encode text, use the Base64 Encoder, and for embedded images, Base64 to Image.
Encoded strings rarely arrive in perfect condition. Text copied from a log may be wrapped across several lines, values taken from web addresses use the alphabet with - and _ instead of + and /, and some APIs drop the = signs from the end. The decoder copes with all of this on its own: whitespace is removed, both alphabets are accepted and missing padding is put back before decoding begins.
If a string truly cannot be decoded, you get an explanation in ordinary words instead of a cryptic browser error. Most of the time the text was never Base64 in the first place, or a character went missing while it was being copied, for example when a long value was cut off by the edge of a terminal window or wrapped by an email program. If the decoded result looks like random symbols, the original was probably a file such as an image rather than plain text.
How to use the Base64 Decoder
- Paste the encoded textLine breaks and stray spaces do not matter; they are removed.
- Read the resultThe decoded text appears straight away beneath the input, with accented letters and emoji shown exactly as they were before encoding.
- Check any warningIf decoding fails, a message explains the likely reason, such as a character outside the Base64 alphabet or a string that was cut short.
- Copy the textUse the copy button to take the decoded result.
Base64 Decoder features
- UTF-8 decoding, so accents, other scripts and emoji come back intact
- Standard and URL-safe alphabets both accepted
- Spaces and line breaks inside the string ignored
- Missing = padding added back automatically
- Errors explained in plain words
- One-click copy of the decoded text
Common uses
- Reading an encoded value from a log file
- Looking inside a token or a query string parameter
- Seeing what a data URI really holds
- Debugging an API field that arrives Base64-encoded
- Recovering text that was encoded for sending
Decoding Base64 in practice: revealing where a link goes, reading raw emails, recognising file types, configuration values and data URIs
Base64 hides content from casual glances, which is exactly why decoding is useful: to see where a tracking link really leads, read an email part that shows as gibberish, identify an unknown blob in a log or check a configuration value. This guide decodes a suspicious link parameter, then covers raw email sources, recognising file types from the first characters, stray newlines in configuration and data URIs.
A worked example: where does this link go?
A message contains a link with a long parameter, such as ?u=aHR0cHM6Ly9leGFtcGxlLmNvbS9sb2dpbg==. Decoding the parameter reveals https://example.com/login, the real destination behind the redirect. Seeing the true address before clicking shows whether a link leads to the site it claims, which is valuable when a message asks you to log in or pay.
Reading raw email source
Email apps can show a message's original source, for example through Show original in Gmail. Parts of the message marked with Content-Transfer-Encoding: base64 appear as blocks of random-looking text. Decoding a text part shows its content exactly as sent, which helps when investigating a suspicious message or a formatting problem. Sender authenticity is judged separately, from the authentication results in the headers.
Recognising what you have
The first characters of Base64 often reveal the type of data inside:
eyJusually begins encoded JSON, such as the parts of a JWT.iVBORw0KGgobegins a PNG image./9j/begins a JPEG image.JVBERi0begins a PDF document.
If the decoded result looks like random symbols, check these prefixes: the data is probably a file rather than text, and needs saving as a file instead of reading as text.
Data URIs
Values beginning with data:image/png;base64, are data URIs. Remove everything up to and including the comma before decoding; the part before the comma states the file type. For images, a dedicated Base64-to-image converter shows the picture directly instead of unreadable bytes.
Configuration values with stray newlines
When a decoded password or key ends with an invisible newline, authentication fails even though the value looks right. This usually happens when the value was encoded with a command that added a newline, such as echo without the -n option. Decoding the stored value and checking its exact length reveals the extra character.
Checking headers in your own logs
When debugging an integration that uses basic authentication, decoding the Authorization header from your own server logs shows which username a client actually sent. Logs containing such headers hold passwords in readable form once decoded, so avoid logging them at all, and treat any existing logs with them as sensitive.
Investigating suspicious scripts
Malicious code injected into websites often hides addresses and commands in Base64 strings decoded at runtime. Decoding these strings reveals where the code sends visitors or data. If you find such code on your own site, treat it as a compromise: clean the files, update software and change all passwords.
When decoding fails
Missing characters from copying, spaces in the middle of a string or text that was never Base64 cause decoding errors. Copy the value again from its source, check where it begins and ends, and make sure surrounding quotes or punctuation were not included.
Common mistakes
- Clicking links without checking their encoded destination.
- Reading binary files as text and assuming the data is corrupt.
- Forgetting to remove the data URI prefix.
- Logging authorisation headers that decode to passwords.
Related tools
To encode text, use Base64 Encoder. For token sections, try JWT Decoder, and for percent-encoded addresses, URL Decoder.
Decoding in code
JavaScript's atob function returns a binary string in which each character represents one byte, so Urdu text decoded with it alone appears garbled. Passing those bytes through TextDecoder restores the original text. In Python, base64.b64decode(value).decode('utf-8') does the same, raising an error if the bytes are not valid UTF-8 text.
Saving decoded files
When the decoded content is a document or image, save it as a file rather than reading it as text. On Linux and macOS, base64 -d input.txt > document.pdf writes the decoded bytes to a file, and on Windows, certutil -decode input.txt document.pdf does the same. The prefixes listed above suggest which extension to use.
Spotting double encoding
If the decoded result is itself a string of letters, digits, plus signs and slashes, possibly ending in equals signs, the original was encoded twice. Decode the result again. When this happens repeatedly in your own system, look for the step that encodes a value that was already encoded.
Very long strings
Browsers handle encoded strings of several megabytes, but some chat apps and text fields cut long messages short when copying. A valid Base64 string, once whitespace is removed, has a length that is a multiple of four when padding is present. A string that fails this check and will not decode has probably been truncated.
Privacy
Decoding happens in your browser. Nothing you paste is uploaded or stored.
Further reading: Base64, URL Encoding and Hashing: What Is the Difference?.
Frequently asked questions
Why won't my string decode?
Either it is not Base64 at all, or something was lost when it was copied. The format is built from a fixed set of 64 characters plus = for padding, so spaces aside, anything outside that set shows the string has been altered or truncated.
Why does the result look like random symbols?
The original data was probably binary, such as a picture, a PDF or a compressed file, rather than text. Showing binary bytes as letters produces nonsense; for images, use the Base64 to Image tool instead.
Do I need to put the = signs back myself?
No. The length of the string tells the decoder how many = signs are missing, and it restores them silently, so trimmed values from APIs and links decode without any fuss.
Can I read a JWT with it?
You can decode its parts one at a time. Split the token at its two dots and paste the first piece for the header or the second for the claims. The third part is a binary signature.
Is the decoded text saved anywhere?
No. The whole job runs inside this page, and its output vanishes once the tab is closed. Nothing is logged, uploaded or kept, even if the string contains private details.
Does a successful decode prove the data is authentic?
No. Base64 has no signature or checksum of its own. Decoding shows what the bytes say, but not who created them or whether they were changed along the way.