Base64 to PDF & Image Viewer
Decode a Base64 string or data URI and instantly preview it as a PDF or image (PNG, JPEG, GIF, WebP, SVG, and more), then download the file.
How to Use the Base64 to PDF & Image Viewer
- Paste a Base64 string or data URI, upload a .txt or .b64 file containing one, or load the PDF or image sample.
- The file type is detected automatically. Choose a type from the File Type menu if you need to override it.
- Preview the decoded PDF or image, along with its type, decoded size, and image dimensions.
- Download the decoded file, or click "Copy Data URI" to reuse it in HTML or CSS.
Base64 to PDF & Image Viewer Features
- Auto-detects PDF, PNG, JPEG, GIF, WebP, SVG, BMP, ICO, AVIF, and TIFF from file signatures
- Accepts raw Base64, data URIs, URL-safe Base64, and strings with line breaks or quotes
- Inline PDF viewer and image preview with dimensions and decoded file size
- Download the decoded file or copy it as a data URI
- 100% client-side decoding with zero uploads
Frequently Asked Questions
How does automatic file type detection work?
The viewer reads the first bytes of the decoded data, known as the file signature or magic number. For example, PDFs contain %PDF- and PNG files start with a fixed 8-byte header. If no signature matches, it falls back to the MIME type declared in a data URI.
What Base64 formats can I paste?
You can paste raw Base64, full data URIs (data:application/pdf;base64,...), URL-safe Base64 that uses - and _, and strings copied from JSON or code that still contain line breaks, escaped slashes, quotes, or missing padding.
Why doesn't my PDF show a preview?
Some browsers, especially on mobile, can't display PDFs inline. The decoded file is still valid, so use the download button to open it in your PDF reader.
Is my file uploaded anywhere?
No. Decoding and previewing happen entirely in your browser, so confidential documents and images never leave your device.