How to use PDF to Base64
- 1. Open a PDF. File picker accepts PDFs on this page.
- 2. Copy Base64. Raw or Data URI presets.
- 3. Use in an API. Many document APIs expect Base64 PDF fields in JSON.
About this tool
“Convert PDF to base64 online” is a common integration task — webhooks and form APIs often want PDF bytes as a Base64 string instead of multipart upload.
Size warning
PDFs grow ~33% when Base64-encoded. Keep source files small or prefer binary multipart uploads for large documents.
Language snippets
Python, JavaScript, Java, and C# all have stdlib Base64 helpers — use this page to verify the payload matches what your backend expects.
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}')