RUNS IN YOUR BROWSER

Base64 Encoder & Decoder

Paste a Base64 string and the decoded result appears in the same tab: readable text when the bytes are valid UTF-8, a named image container or a byte report with a download when they are not. You can also open a .txt or .b64 file that holds the string instead of pasting it. Both alphabets are accepted — standard with + and /, URL-safe with - and _ — and the tool reports which one it saw. Spaces, tabs, line breaks, non-breaking spaces and a stray byte order mark are counted and ignored rather than decoded as data, and a data: URL prefix is stripped and reported with the media type it declares. Every rejection carries a stable code, and the validation errors that can point at a character — an invalid character, mixed alphabets, misplaced or excess padding, an impossible length, or a data: URL without the base64 marker — also give the exact index, line and column in the string as you pasted it; the size and empty-input refusals have no single character to blame, so they report the counts and the limit instead. The encoder runs the other way: text or bytes become Base64 in the standard or URL-safe alphabet, padded or unpadded, with the decoded byte length reported rather than the character count.

File types: .txt, .b64Processing: This browser

or drop a file here

Stays on this deviceMaximum size: 1.9 MB
HOW TO USE IT

How to use Base64 Encoder & Decoder

01

Add your file

Choose or drop a .txt or .b64 file. You can paste the contents instead.

02

Let it read the file

The file is read and parsed in this browser — nothing is uploaded.

03

Check the result

Look over what came back, then copy it, download it, or move on.

Common questions

How do I decode a Base64 string in the browser?

Paste the Base64 string into the input box and the decoded result appears in the same tab immediately — no button, no account and no upload. If the string lives in a file you can open a .txt or .b64 file instead of pasting. The decoder reads both the standard (+ /) and the URL-safe (- _) alphabet, silently skips the line breaks, tabs and spaces that came along with the paste, and shows the decoded byte length beside the result.

How do I encode my own text into Base64 and copy the result?

Switch to the encode side, paste your text or pick a .txt file, and the Base64 output appears with canonical padding by default. Your text is turned into UTF-8 bytes first, so accented letters, CJK characters and emoji survive a round trip unchanged. You can select the URL-safe alphabet when the result has to sit inside a URL or a filename, or switch padding off when the receiving system expects an unpadded string; copy and download always take the full output, not the shortened on-screen preview.

Is my Base64 data uploaded to a server when I decode it?

No — the string you paste never leaves the tab, because decoding runs entirely inside the page you already loaded and makes no network request. That matters for the Base64 blobs people usually decode: session tokens, log fragments, configuration secrets and mail attachments that you are often not allowed to paste into a remote service at all.

Does this Base64 decoder work offline?

Yes, once the page has loaded you can disconnect the network and keep decoding and encoding, because nothing is fetched while a string is decoded. An air-gapped laptop behaves exactly like a connected one. The only thing that needs the network is loading the page in the first place, so keep the tab open if you know the connection is about to go away.

How do I decode a Base64 string on Windows 11 without installing software?

Open the page in Edge, Chrome or Firefox on Windows 11 and paste the string — no software is installed and no PowerShell command is needed. It is usually quicker than certutil -decode, which insists on a file on disk and a temporary path, and unlike the command line it points at the exact character position when the string turns out to be malformed instead of just failing.

Why does the Base64 decoder report an invalid character, and where is it?

It means a character outside both Base64 alphabets appeared in the payload, and the message names that character together with its exact index, line and column. The position refers to the string exactly as you pasted it, so it can be highlighted rather than hunted for. The usual culprits are a curly quotation mark copied out of JSON, an ellipsis from a truncated log line, or a stray angle bracket from surrounding XML.

Why does my decoded Base64 show as binary instead of readable text?

Because the decoded bytes are not valid UTF-8 or carry control bytes that no text file would contain, so they are reported as binary instead of mojibake. The check is strict and never substitutes replacement characters: you get an honest verdict plus the byte offset of the first broken sequence. If the bytes start with a known image signature — PNG, JPEG, GIF, WebP, BMP, TIFF or ICO — the container is named and the payload is offered as a download.

How large a Base64 string can this decoder handle?

The input is capped at 2,000,000 characters and the decoded payload at 2,000,000 bytes, and both ceilings are checked before any memory is allocated. An oversized paste is therefore refused instantly with a size error that reports the counts and the limit rather than freezing the tab while it allocates a buffer it cannot fill. Long text results are shown up to 200,000 characters on screen, while copy and download still carry the whole payload.

Does a Base64 string still decode if the trailing = padding is missing?

Yes — a string whose length leaves a remainder of two or three characters decodes normally and is simply flagged with a note that the padding was absent. Unpadded Base64 is the norm in JWTs and URL parameters, so treating it as an error would be wrong. What is rejected is padding that is wrong rather than missing: too many = signs, a partial pad, data appearing after the padding, or a length remainder of one character, which cannot come from any complete byte.

Is it safe to decode a Base64 attachment I received in an email?

Decoding is safe here because the payload is only ever treated as inert bytes: nothing is executed, no decoded HTML is rendered and no URL inside it is fetched. The risk moves to what you do next — a decoded installer or a macro-bearing document is exactly as dangerous once you save and open it as it was inside the message. This tool tells you what the bytes are; it does not scan them for malware.

What is the difference between standard Base64 and URL-safe Base64?

Standard Base64 uses + and / for the values 62 and 63, while URL-safe Base64 uses - and _ so the string can sit inside a URL or a filename untouched. Both decode to identical bytes, and this tool accepts either one and tells you which it detected. A string that mixes the two is refused, because that combination almost always means two different strings were spliced together during copy-paste.

If a Base64 string decodes cleanly, does that mean the content can be trusted?

No — a clean decode proves only that the characters formed a well-formed Base64 sequence, not that the data is authentic or that nobody altered it. Base64 is an encoding, not encryption and not a signature: anyone can modify a payload, re-encode it, and it will decode just as cleanly. Judge the content on where it came from, not on the fact that it decoded.

Can I paste a whole data: URL such as data:image/png;base64,... ?

Yes — the data: prefix is recognised, stripped and reported back with the media type it declares, and only the part after the comma is decoded. That keeps the prefix out of the byte count and out of the download. A data: URL without the ;base64 marker is refused instead of being decoded anyway, because a percent-encoded data: URL is a different format and reading it as Base64 would produce nonsense.