Loading tool…

PDF to Base64

Convert PDF to Base64 — drop the file in Encode → File mode and copy the string or `data:application/pdf;base64,…` URI.

How to use PDF to Base64

  1. 1. Open a PDF. File picker accepts PDFs on this page.
  2. 2. Copy Base64. Raw or Data URI presets.
  3. 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}')

This is one direction of Base64 Studio. The editor is the same; the title and default direction match this search.

Frequently asked questions

Related tools

All tools