Blog
Image Tools
Crop Image
Resize Image
Rotate & Flip
Compress Image
Photo Filters
Meme Generator
GIF Maker
Collage Maker
Watermark Image
Blur Image
Convert
JPG to PNG
PNG to JPG
HEIC to JPG
DNG to JPG
Image Converter
PDF to JPG
JPG to PDF
Merge PDF
Compress PDF
MP4 to MP3
Video to GIF
MOV to MP4
MP3 Converter
Video & Audio
Trim Video
Crop Video
Remove Audio
Text to Speech
Audio Cutter
MP3 Compressor
Design & Editor
Resume Builder
Design Editor
Add Text to Photo
Social Media Resizer
QR Code Generator
Signature Generator
More Tools
Word Counter
Password Generator
Random Picker
Dice Roller
Spinner Wheel
Favicon Generator
Barcode Generator
Browse All Tools

PDF to Base64 Converter

Need to send a PDF through a web service, store it in a database or embed it in a web page? Encode it as Base64 in one step. Choose plain Base64 or a ready-made data URI, wrap lines if your system needs it, and copy or download the result.

100% Free
No Sign-up
No Watermark
Data URI Option
Up to 50 MB
Browser-Based · Private
Drop the PDF you want to encode

or choose a source below

From Device
From Dropbox
From Google Drive
From OneDrive
From URL
Supports PDF  ·  One file, up to 50 MB

How to Convert a PDF to Base64

Quick answer: drop your PDF in, choose Base64 only or Data URI, tick line wrapping if needed, then press Copy to Clipboard or Download .txt.

  1. 1

    Add your PDF

    Drop the file. It is encoded straight away.

  2. 2

    Choose the format

    Base64 only, or a data URI that starts with data:application/pdf;base64,

  3. 3

    Wrap lines if needed

    Tick wrapping for systems that expect 76-character lines, such as email.

  4. 4

    Copy or save

    Copy the full string or download it as a .txt file.

What You Get

Instant Encoding
No waiting
Data URI
Ready for web pages
Line Wrapping
76 characters
Full Copy
Even for big files
Size Info
See the increase
100% Private
Nothing is uploaded

What Is Base64?

Base64 is a way of writing any file, including a PDF, using only letters, numbers and a few symbols. Computers use it to send files through systems that are designed for text, such as web services, XML messages, email bodies, configuration files and databases. The PDF itself does not change; it is simply written in a text-friendly form, and the receiving system turns it back into the same file.

Base64 makes data about one third larger than the original, so a 3 MB PDF becomes roughly 4 MB of text. The summary shows the exact size increase for your file.

Base64 or Data URI?

Base64 only gives the raw encoded string. Use it for web services and databases that ask for a "base64" field, for example when sending invoices, signed documents or attachments to a web service. Data URI adds data:application/pdf;base64, at the start, so the string can be used directly as a link or embedded in HTML, which some browsers and apps can open as a PDF.

Wrap lines at 76 characters breaks the string into short lines, the format used in email (MIME) and some older systems. Leave it off for web services and JSON, which expect one continuous string.

Large Files

Very long strings can slow down a browser text box, so for large PDFs the middle panel shows the start of the result and tells you how many more characters there are. Copy to Clipboard and Download .txt always give you the complete string. Files up to 50 MB are supported, which covers almost every document used with web services and email systems.

Example: Sending a PDF to an Online Service

An accounting web service asks for invoices as a Base64 field in a JSON request. Drop the invoice PDF in, keep Base64 only and leave wrapping off, then press Copy to Clipboard and paste the string into your request body as the value of the field. When the service decodes it, it receives the identical PDF, byte for byte.

Who Uses PDF to Base64?

Developers and testers prepare sample payloads for web services and automated tests. Integration and support teams debug document uploads, low-code builders store PDFs in database fields, and email template designers embed small PDFs in messages. Because encoding happens in your browser, it is safe to use with real documents rather than dummy files.

Tip: before sending a large document to an online service, check its size limit. Base64 adds about a third to the size, so a 9 MB PDF becomes roughly 12 MB of text. Compressing the PDF first keeps requests fast and avoids rejected uploads.

Everything is encoded on your device, so you can safely encode contracts, invoices and other private documents without them ever being sent to our servers.

Related Tools

To turn a Base64 string back into a PDF, use Base64 to PDF. If your PDF is too big for an upload limit, compress it first. For working with JSON payloads, the JSON Formatter helps you check your request. Everything runs in your browser.

PDF to Base64: Sending Documents Through Text-Only Channels

APIs, JSON files and some databases cannot carry raw binary, so documents are written as Base64 text. A PDF becomes a long string that starts with JVBERi0.

What to know

The string is about 33 percent longer than the file. Most services have limits on request size, so large PDFs may need to be compressed first with compress PDF. Base64 is not encryption, so anyone with the string can rebuild the file.

To rebuild a PDF, use Base64 to PDF.

Frequently Asked Questions

Questions about converting PDF to Base64

How do I convert a PDF to Base64?

Drop the PDF in. The Base64 text appears straight away; copy it or download it as a .txt file.

What is a data URI?

It is the Base64 string with data:application/pdf;base64, in front, so it can be used directly as a link or in HTML.

Why is the Base64 text bigger than the PDF?

Base64 always makes data about 33 percent larger, because it uses only text characters.

Should I wrap the lines?

Only if your system expects 76-character lines, such as email. web services and JSON want one continuous string.

Is there a size limit?

Up to 50 MB per PDF.

Is my PDF uploaded?

No. Everything happens inside your browser. Your file never leaves your device and nothing is stored on a server.