Base64 Encode / Decode API - Auto-Detect + Type Sniffing avatar

Base64 Encode / Decode API - Auto-Detect + Type Sniffing

Pricing

$10.00 / 1,000 operation runs

Go to Apify Store
Base64 Encode / Decode API - Auto-Detect + Type Sniffing

Base64 Encode / Decode API - Auto-Detect + Type Sniffing

Base64 encoder/decoder API supporting Base64 and Base64URL. Input: a string (auto-detects encode vs decode direction). Output: JSON with the converted result and, when decoding, the sniffed content type (JSON, image, PDF, text). Cheap pay-per-operation pricing.

Pricing

$10.00 / 1,000 operation runs

Rating

0.0

(0)

Developer

Anthony Snider

Anthony Snider

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Base64 Encoder / Decoder

Encode or decode Base64 (and Base64URL) in one call — it auto-detects the direction, and when decoding it sniffs the real content type of the result (JSON, PNG, JPEG, GIF, PDF, ZIP, or plain text).

Live on the Apify Store — run it instantly or call it as an agent tool via Apify MCP.

What you get

  • Auto-direction: valid Base64 gets decoded, anything else gets encoded — or force encode/decode.
  • Base64URL support: encode with the URL-safe alphabet (- _, no padding); decoding accepts both alphabets automatically.
  • Content sniffing on decode: magic-byte detection for image/png, image/jpeg, image/gif, application/pdf, application/zip, plus application/json and text/plain via UTF-8 validation.
  • Clean output: { direction, output, detectedType, byteLength } per item. Binary results come back as Base64 so they're JSON-safe.
  • Single string or bulk array in one run.

Input

{ "input": "Hello, Apify!", "direction": "auto", "urlSafe": false }

Or process many at once:

{ "items": ["aGVsbG8=", "https://apify.com"], "maxItems": 50 }

Output

{
"direction": "encode",
"input": "Hello, Apify!",
"output": "SGVsbG8sIEFwaWZ5IQ==",
"detectedType": null,
"byteLength": 13,
"urlSafe": false
}

Decoding a JSON payload:

{
"direction": "decode",
"input": "eyJvayI6dHJ1ZX0=",
"output": "{\"ok\":true}",
"detectedType": "application/json",
"byteLength": 11,
"urlSafe": false
}