How to Decode Base64 Online
How do I decode Base64?
Paste the Base64 string into a decoder, fix any missing padding, choose standard or URL-safe, and decode. The tool does it 100 percent locally, shows the text if it is readable, or names the file type like PNG, PDF, or ZIP and lets you download the bytes.
The three steps
Open the Base64 decoder, paste the Base64 text into the left editor, or drop a .b64 file, and press Decode or hit Ctrl or Command plus Enter. If the content is text you see it on the right, if it is binary you get a file type badge and a download button. Nothing is uploaded and large inputs run in a background worker.
Standard versus URL-safe
Standard Base64 uses plus and slash, URL-safe replaces them with dash and underscore and drops padding. If a string fails to decode, try the other alphabet. This site handles both and auto fixes missing padding characters so a truncated copy still decodes.
Fixing padding
Valid Base64 length %4 ==1 is always illegal and throws Incomplete base64 group (engine.ts:84). Length %4 ==2 or 3 is recoverable via tailBytes (1 or 2 bytes), but === is never valid and throws Incorrect padding (engine.ts:85). Standard decoders do not auto-pad, so add = until length %4 ==0, then replace - with + and _ with / before decoding if the string is URL-safe.
What the tag means
After decoding the tool reads the first bytes and names common formats: PNG 89 50 4E 47, JPEG FF D8 FF, GIF 47 49 46, WebP, PDF 25 50 44 46, ZIP 50 4B, gzip 1F 8B, or marks it as JSON via JSON.parse or plain text via control-char check. If the result is binary you see a clean byte count instead of unreadable characters.
Text versus file
Not every Base64 string is text. A data URI like data:image/png;base64,iVBORw0KGgo must have the prefix stripped manually with /^data:[^;]+;base64,/ before decode, otherwise the decoder throws Invalid character ':' at position 5 (engine.ts:80) because : is not in the alphabet. After stripping, the tool decodes and the tag reads PNG via sniffBytes 89 50 4E 47. For a plain string the decoder tries UTF-8 first, and only falls back to a byte view when the bytes are not valid text.
Is decoding safe for secrets
Base64 is an encoding, not encryption. Anyone can decode it, so it hides nothing. Decode only where transport required it, such as an Authorization header or a data URI, and never rely on Base64 for secrecy. For sensitive payloads use a local decoder that never uploads the data.
Try it in your browser with our Base64 Encode / Decode. No upload, no server.
Open Base64 Encode / Decode →FAQ
Can I decode Base64 without uploading?
Yes. Paste the string here and it decodes entirely in your browser, in a background worker for large inputs. Nothing leaves your machine.
Why does my string say invalid Base64?
The length is not a multiple of four, it contains characters outside the alphabet, or it mixes standard and URL-safe alphabets. Add missing padding, remove whitespace, and pick the correct alphabet.
What is the difference between standard and URL-safe Base64?
Standard uses plus and slash, URL-safe uses dash and underscore and omits padding so the string can sit in a URL or query parameter without escaping.
Can this decode an image or a PDF
Yes. Paste the Base64 for an image, a PDF, or a ZIP and the tool detects the format from the decoded bytes and offers a download. A data URI prefix is handled automatically.