Free · Client-side · No upload

PDF to Base64 Converter

Encode a PDF file to base64 for use in AI APIs, or decode a base64 string back to a downloadable PDF. Everything runs in your browser — nothing leaves your device.

Paste your key once — it's saved in your browser and injected into code snippets automatically.

Drop a PDF here or click to browse

Supports .pdf files of any size

How it works

Upload PDF

Drop or select any PDF. The browser reads it using the FileReader API — no network request is made.

Get base64 string

The raw bytes are encoded to base64 instantly. Copy it directly into an API request body or your code.

Use in AI APIs

Send the base64 string to Claude, Gemini, or any multimodal model that accepts document input. Use the built-in snippets to get started.

Frequently asked questions

Is my PDF uploaded anywhere?

No. The FileReader API reads the file entirely in your browser's memory. Nothing is sent to any server — not even AICredits' servers.

Which AI APIs accept PDF as base64?

Anthropic Claude (claude-opus-4-8 and newer) accepts PDFs natively via the document content type. Google Gemini also supports inline PDF data via base64.

What is the size limit?

There's no limit imposed by this tool — it's all in-browser. However, most AI APIs cap document size: Claude allows up to 32 MB per PDF.

Can I decode a base64 string back to PDF?

Yes — switch to the "Base64 → PDF" tab, paste your string, and click Download. The browser reconstructs the binary file from the base64 data.

Sending PDFs to Claude or Gemini?

AICredits gives you one API key to access Claude, Gemini, GPT-4o, and 300+ other models — pay only for what you use in INR.

Get started free →