How to use Base64 to PDF
- 1. Paste Base64. Raw or `data:application/pdf;base64,…`.
- 2. Confirm PDF detection. Detected label should say PDF document.
- 3. Download. Save as .pdf.
About this tool
“Base 64 to pdf” is the reverse of PDF→Base64 — common when an API returns a document as a Base64 field.
Preview
Modern browsers can show PDFs in an iframe from a Blob/Data URI. If preview fails, download still works when magic bytes are `%PDF-`.
Code examples
Node
Buffer.from("hello").toString("base64");
Buffer.from(b64, "base64").toString("utf8");Browser (UTF-8 safe)
btoa(unescape(encodeURIComponent(text)));
decodeURIComponent(escape(atob(b64)));Python
import base64
base64.b64encode(b"hello").decode() # aGVsbG8=
base64.b64decode("aGVsbG8=").decode()Data URI
const uri = `data:image/png;base64,${b64}`;
// <img src={uri} /> or CSS url('${uri}')