Base64 Encoder & Decoder – Image to Base64, File & Data URI
Pricing
from $0.80 / 1,000 files converted
Base64 Encoder & Decoder – Image to Base64, File & Data URI
Image to Base64, URL to Base64, file and PDF to Base64 or data URI in bulk, and Base64 to file or text. Base64 encoder and decoder for images, PDFs and any file: Dropbox/Drive links, MIME detection, base64url, optional image resize for LLM vision payloads. $0.80 per 1,000 files.
Pricing
from $0.80 / 1,000 files converted
Rating
0.0
(0)
Developer
Cemal Atakli
Maintained by CommunityActor stats
0
Bookmarked
62
Total users
34
Monthly active users
7 days ago
Last modified
Categories
Features
Share
Base64 Encoder & Decoder – Image, PDF & File to Base64 / Data URI and Back
Convert any file to Base64 in bulk: images, PDFs, documents, audio or plain text. Get standard Base64, URL-safe base64url or a ready-to-paste data URI (data:image/png;base64,...). It also works the other way: decode Base64 or data URIs back into files or text, with the file type detected for you.
Built for automation: n8n, Make, Zapier and AI-agent workflows that need a data URI for an LLM vision API, an email attachment, a JSON payload or an HTML/CSS embed. $0.80 per 1,000 files, $0.20 per 1,000 texts. Failed and blocked inputs are free.
What it does
- Encode file URLs (direct links, Dropbox, Google Drive and GitHub share links are turned into direct downloads) and plain text (UTF-8).
- Three output formats: standard Base64 (optionally wrapped at 76 characters, MIME style), base64url (URL-safe, no padding) and data URI with the detected MIME type.
- MIME detection from the file content, not just the extension or server header: PNG, JPEG, WebP, AVIF, GIF, SVG, PDF, ZIP, MP3, MP4 and more.
- Optional image resize before encoding, e.g. max 1024 px, and re-encode as JPEG/PNG/WebP. This keeps LLM vision payloads and data URIs small. EXIF rotation is applied.
- Decode standard Base64, base64url (with or without padding) and data URIs (also percent-encoded
data:,Hello%20World). Whitespace and line breaks are ignored. Text and JSON come back as text; images, PDFs and other binaries are saved as downloadable files with the correct extension. - Large outputs are handled for you: outputs up to
inlineMaxKb(default 256 KB) are returned in the dataset row; bigger ones are saved as a.txtrecord in the key-value store and the row gets afileUrl. - Every row has file name, MIME type, input and output size and a SHA-256 checksum.
- Safe and clear errors: web pages returned instead of files, HTTP errors, files over the size limit, private network addresses and social/video platform links (YouTube, TikTok, Instagram…, whose terms forbid downloading) each give a free error row. One bad input never stops the run.
Use cases
- Send images to OpenAI, Claude or Gemini vision APIs as data URIs from a no-code workflow.
- Embed logos and icons in HTML emails, CSS or JSON configs.
- Attach PDFs to APIs that only accept Base64 (invoicing, e-signature, email-sending APIs).
- Decode Base64 attachments from webhooks or API responses back into real files.
- Check a file's checksum and MIME type in bulk.
Input example
{"mode": "encode","fileUrls": ["https://example.com/photo.jpg", "https://www.dropbox.com/scl/fi/abc/invoice.pdf?dl=0"],"outputFormat": "dataUri","resizeMaxPx": 1024}
Decode:
{ "mode": "decode", "base64Inputs": ["SGVsbG8sIEFwaWZ5IQ==", "data:application/pdf;base64,JVBERi0xLjQK..."] }
Output example
{"status": "ok", "type": "file", "input": "https://apify.com/img/apify-logo/logomark-32x32.svg","fileName": "logomark-32x32.svg", "mimeType": "image/svg+xml", "inputSizeBytes": 688, "outputSizeBytes": 946,"sha256": "5c1f…", "outputFormat": "dataUri","output": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhl…", "charged": true}
A decoded binary file:
{ "status": "ok", "type": "decode", "mimeType": "application/pdf", "decodedSizeBytes": 15214,"fileName": "decoded-0003.pdf", "fileUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/decoded-0003.pdf" }
The OUTPUT record summarises the run: files and texts converted, failures and megabytes processed.
Pricing (pay per event)
| Event | Price |
|---|---|
| File converted (encode or decode, up to 10 MB) | $0.0008 |
| Text converted (encode text, or decode to text) | $0.0002 |
| Each further started 10 MB of a large file | $0.0015 |
| Actor start | $0.00005 |
Errors, blocked URLs and skipped files are free. Set a maximum cost per run and the Actor stops cleanly at that limit.
| Actor | Per file | Per text |
|---|---|---|
| This Actor | $0.0008 | $0.0002 |
| eliai/base64-encoder-decoder | $0.002 | $0.001 |
Competitor prices are from the Apify Store on 2026-10-18.
FAQ
What is the size limit? 25 MB per file by default (maxFileSizeMb, up to 500 MB). Base64 output is about 33% larger than the file.
Why did my Google Drive link fail? The file must be shared as "Anyone with the link". Private links return a sign-in page, which the Actor reports as a free error.
Can I get the output without the data: prefix? Yes, choose base64 or base64url.
Is my data stored? Only in your own run's dataset and key-value store, which follow your Apify data retention settings.
Use with AI agents (Apify MCP)
This Actor works as a tool in the Apify MCP server. An agent can call it to turn an image URL into a data URI for a vision model, or to decode a Base64 attachment into a downloadable file.