Base64 decode online
How to decode Base64
Base64 represents binary data using only 64 safe characters: A-Z, a-z, 0-9, + and /, with = as padding. Every 3 bytes of data become 4 characters, so Base64 is about 33% larger than the original. It is how email attachments, JSON Web Tokens, API payloads, Kubernetes secrets and inline images carry bytes through systems that only accept text.
To decode Base64 online, paste the string and click Convert. The decoder is strict: it only accepts valid Base64 characters and tells you if the length is impossible, instead of quietly returning garbage. It also accepts the common variations so you do not need to clean the input first:
- A full data URI such as
data:image/png;base64,iVBORw0.... The prefix is stripped and the declared type is used.
- Base64URL (with
- and _ instead of + and /), used in JWTs and URLs.
- Missing
= padding, line breaks and spaces from MIME email bodies.
Need to decode many values? Tick Each line separately and every line is decoded on its own.
Base64 to image and PDF
Decode Base64 to an image, PDF or file
When the decoded bytes are not text, the tool detects the real file type from its contents (the "magic bytes"), not from a guess. If it is an image, you get a Base64 to image preview straight away, with a download button for the file. PNG, JPEG, GIF, WebP, SVG, ICO and AVIF are recognised.
The same works for Base64 to PDF: paste the string from an API response or an email source and download decoded.pdf. ZIP archives, Word and Excel documents, fonts, audio and other files are detected too, with the right file extension.
Base64 to hex
For low-level debugging choose Hex string for one continuous run of hexadecimal bytes, or Hex dump for the classic three-column view with byte offset, hex pairs and printable ASCII. That is the quickest way to inspect a binary token, a hash stored as Base64 or the header of an unknown file.
Text encodings
Base64 encodes bytes, not letters. If decoded text shows strange characters like é, the original was probably not UTF-8. Switch Text character set to Windows-1252 (Latin-1) or UTF-16. The same setting applies when encoding, which matters for systems such as PowerShell -EncodedCommand that expect UTF-16LE.
Advertisement
Base64 encode
Encode text and images to Base64
The Base64 encode tab converts text to Base64. Options cover every common variant:
- URL-safe (Base64URL) replaces
+ and / so the result can go in a URL or file name without percent-encoding.
- No padding removes trailing
=, as required by JWT and many APIs.
- Wrap at 76 characters produces MIME-compatible line lengths for email.
The File or image to Base64 tab turns an upload into a data URI, plain Base64, a CSS background-image rule or a ready <img> tag. Inlining small icons and logos this way saves an HTTP request. For anything larger than a few kilobytes, a normal image file is usually faster because browsers can cache it separately.
Good to know
Base64 is encoding, not encryption
Anyone can decode Base64, so it gives no protection at all. Never treat a Base64 value as hidden: API keys, passwords and personal data inside Base64 strings, Basic Auth headers or JWT payloads are fully readable. Use proper encryption or a hash when you need security.
Base64 also is not compression. The output is always about a third larger than the input, plus line breaks if you wrap it.
Working with URLs instead? Percent-encoding is a different scheme, handled by the URL decode and encode tool. To read a decoded JSON payload, paste it into the JSON formatter.
FAQ
Base64 Decode & Encode: frequently asked questions
How do I decode Base64?
Paste the Base64 string into the Base64 decode tab and click Convert. Text is shown directly. Images, PDFs and other files are detected automatically with a preview and a download button.
How do I convert Base64 to an image?
Paste the Base64 string, with or without the data:image/...;base64, prefix, and click Convert. The decoder detects PNG, JPEG, GIF, WebP, SVG and other formats, shows the image and lets you download it.
Can I decode Base64 to PDF?
Yes. Paste the Base64 that represents the PDF and click Convert. The tool detects application/pdf and offers decoded.pdf for download.
How do I convert an image to Base64?
Open File or image to Base64, upload the image and choose Data URI, plain Base64, CSS or an HTML img tag as the output.
What is Base64URL?
Base64URL is a variant that uses - and _ instead of + and /, and usually drops the = padding, so it is safe in URLs and file names. JWTs use it. The decoder accepts both variants automatically.
Why does my decoded text have strange characters?
The original text was probably in a different character set. Change Text character set to Windows-1252 or UTF-16 and convert again.
Is Base64 encryption?
No. Base64 is a reversible encoding that anyone can decode. It does not protect data.
Is there a size limit?
You can paste up to 4 MB of text, and upload files up to 3 MB for encoding. Nothing is stored after the result is shown.