Encode text (UTF-8) or any file to Base64, URL-safe Base64 or a data URI, with optional MIME wrapping.
Base64 Decoder
Decode Base64 back to text — or, when it holds a file, see what kind of file it is, preview images and download it. Errors point to the exact character.
Decoded locally in your browser — nothing is uploaded
How it works
- Strips a
data:…;base64,prefix if present (and notes its MIME type), and ignores whitespace. - Checks every character, the position of
=padding and the length. Problems are reported with their position. - Converts URL-safe characters, restores missing padding and decodes to bytes.
- Tries to read the bytes as UTF-8 text. If they aren’t text, it checks the first bytes against known file signatures (PNG, JPEG, GIF, WebP, AVIF, SVG, PDF, ZIP, gzip, MP4, MP3, fonts). It previews images and offers a download with the right extension.
Example
SGVsbG8sIE16YW5zaSEg8J+Riw== decodes to Hello, Mzansi! 👋. The URL-safe form SGVsbG8sIE16YW5zaSEg8J-Riw gives the same result.
iVBORw0KGgo= decodes to the 8-byte PNG signature, so the decoder reports “PNG image” instead of showing unreadable characters.
SGVs*G8= gives: “*” at position 5 is not a Base64 character.
Frequently asked questions
Why does my decoded text look garbled?
The Base64 probably holds binary data (an image, PDF or compressed file), not text. The decoder detects common file types from their first bytes, previews images, and lets you download the file with the right extension.
Does it handle URL-safe Base64 and missing padding?
Yes. Standard and URL-safe (- _) Base64 are detected automatically, missing = padding is fine, and spaces and line breaks are ignored. A data: URI prefix is recognised and stripped.
What do the error messages mean?
The decoder points to the exact position of an invalid character, misplaced = padding, or a length that suggests the text was cut off — instead of quietly producing garbage. Use “Show error” to jump to the problem.
Is my data sent anywhere?
No. Decoding uses your browser’s built-in functions; nothing is uploaded. That matters because Base64 often wraps credentials, tokens and private files.
Can I decode a JWT here?
You can decode each part, but the JWT decoder does it properly: it splits the token, decodes the header and payload, explains the claims and can verify the signature.
Related tools
Decode a JSON Web Token, check its claims and expiry, flag risks, and verify HS, RS, PS, ES or EdDSA signatures.
Decode percent-encoded text, unwrap double encoding and see every query parameter of a URL in a table.
Generate random v4 or time-ordered v7 UUIDs in bulk, in the format you need.
Related guides
JSON, Base64, URL encoding and HTML entities explained
What JSON, Base64, percent-encoding, HTML entities, UUIDs and Unix timestamps are for — and the common mistakes developers make with each.
JWTs explained: structure, claims, decoding vs verifying, and common mistakes
How JSON Web Tokens work, what each part and claim means, why decoding isn't verifying, and the mistakes that cause real security bugs.
CSS colour formats explained: HEX, RGB, HSL, HWB and OKLCH
What each CSS colour format means, when to use it, why OKLCH is useful for palettes, and how to check colour contrast for accessibility.