Base64 Encoder & Decoder: Files, Images & Text to Data URI avatar

Base64 Encoder & Decoder: Files, Images & Text to Data URI

Pricing

from $0.80 / 1,000 texts

Go to Apify Store
Base64 Encoder & Decoder: Files, Images & Text to Data URI

Base64 Encoder & Decoder: Files, Images & Text to Data URI

Encode text, or any file or image by URL, to Base64 and a data: URI; decode Base64, base64url or data URIs back to text or a downloadable file. Batch input, the file type detected, URL-safe alphabet. Failed items are free.

Pricing

from $0.80 / 1,000 texts

Rating

0.0

(0)

Developer

Spyridon Pikoulas

Spyridon Pikoulas

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

16 hours ago

Last modified

Features

Limited permissions

Share

Encode text, or any file or image by URL, to Base64 and a ready data: URI; decode Base64 back to text or the original file. A row per item, so a list of a thousand goes in one run:

  • Encode texts: each text's UTF-8 bytes as Base64, in the standard alphabet or base64url.
  • Encode files by URL: images, PDFs, documents, audio, anything up to 100 MB, with the Base64, a data: URI to paste into <img src>, CSS or an email, and the file's type read from its bytes.
  • Decode: Base64, base64url (with or without = padding) or a data: URI back to its text, or, for an image, a PDF or any binary, to a file with a download link.

It costs $0.80 per 1,000 texts and $1.60 per 1,000 files. Items that fail are free.

What people use it for

  • APIs and webhooks: an image or PDF as Base64 inside a JSON payload, or the file inside a Base64 attachment someone sent.
  • HTML, CSS and email templates: images inlined as data: URIs.
  • Make, Zapier and n8n: encoding or decoding as one hosted step between two apps.
  • AI agents: a file as Base64 for a model's input, or a model's Base64 output as a file.

How to encode a file to Base64

  1. Click Try for free; Apify's free plan covers a first run.
  2. Pick Encode or Decode, and add Texts or File URLs.
  3. Click Start, then download the results as JSON, CSV, Excel or HTML, or read them through the API.

An input with more options:

{
"mode": "encode",
"texts": ["Hello from Apify!"],
"urls": ["https://www.python.org/static/img/python-logo.png"],
"urlSafe": false,
"maxFileSizeMb": 25
}

Output

A file encoded:

{
"mode": "encode",
"url": "https://www.python.org/static/img/python-logo.png",
"finalUrl": "https://www.python.org/static/img/python-logo.png",
"fileName": "python-logo.png",
"contentType": "image/png",
"inputBytes": 15770,
"alphabet": "standard",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAkQAAACkCAYAAAB2OzHx...",
"dataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkQAAACkCAYAAAB2OzHx...",
"base64Url": null,
"processedAt": "2026-11-20T21:54:55Z",
"error": null
}

A Base64 string decoded:

{
"mode": "decode",
"input": "SGVsbG8sIHdvcmxkIQ==",
"kind": "text",
"contentType": "text/plain",
"decodedBytes": 13,
"text": "Hello, world!",
"textUrl": null,
"fileUrl": null,
"processedAt": "2026-11-20T21:54:57Z",
"error": null
}

A row holds up to 3 MB of Base64 or text; past that, base64Url or textUrl links the whole of it in the run's key-value store. A decoded image, PDF or other binary is always a file at fileUrl; decoded text is too with Decoded text as a file too. contentType is the type a data: URI declares, or else the one read from the file's first bytes and name (PNG, JPEG, GIF, WebP, AVIF, SVG, PDF, ZIP and Office files, MP3, MP4, WAV and more). A failed item has its reason in error.

Use it as an API

One call runs it and returns the results as JSON (for runs under 5 minutes; longer ones start a run and read its dataset). Apify's Python and JavaScript clients, and its Make, Zapier and n8n integrations, work the same way.

curl -X POST "https://api.apify.com/v2/acts/pikoulas~base64-encoder/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://www.python.org/static/img/python-logo.png"]}'

AI agents can call it as a tool through Apify's MCP server: https://mcp.apify.com?tools=pikoulas/base64-encoder.

How much does it cost to encode files to Base64?

You pay $0.0008 per text encoded or decoded and $0.0016 per file downloaded and encoded, $0.80 and $1.60 per 1,000, on Apify's paid plans, and $1.20 and $2.40 per 1,000 on the free plan. Items that fail aren't charged. There are no monthly fees. Set a spending limit on a run and it stops there with what it has.

Good to know

  • Files are downloaded as a guest of each website: it says who it is, keeps to the site's robots.txt, waits a second between requests to one site, and leaves a site that refuses alone. Private and local network addresses aren't read.
  • Decoding takes both alphabets, ignores line breaks and spaces, and adds missing = padding.
  • The data: URI always uses the standard alphabet, as browsers expect, even with URL-safe alphabet on.

FAQ

Is Base64 encryption?

No: anyone can decode it. It makes binary data safe to carry as text, in JSON, URLs, HTML or email.

Something missing or not working?

Open an issue on the Issues tab with the input you used, or ask there for a field you need.

If it does what you need, a review on the Reviews tab helps others find it.