Base64 Encode / Decode

Encode strings to Base64 and decode Base64 back to plain text. Supports standard and URL-safe (base64url) variants.

Get API Key

Overview

Use Cases

  • Encode binary data for safe transmission in JSON or HTML
  • Decode Base64 payloads from third-party APIs or webhooks
  • Build developer tools and data inspection utilities
  • URL-safe encoding for tokens in URLs and filenames
  • Encoding credentials for Basic Auth headers

Features

Standard Base64 encoding and decoding (RFC 4648)
URL-safe Base64 encoding and decoding (base64url, RFC 4648 Β§5)
Returns 422 with a clear error for invalid Base64 input
Zero dependencies β€” fast, in-memory only

API Endpoints

Encode

Encode a plain-text string to Base64

POST
https://api.requiems.xyz/v1/convert/base64/encode

Parameters

Name Type Required Description
value string Required The string to encode
variant string Optional Encoding variant: standard (default) or url (URL-safe base64url)

Try it out

Live Demo
Request

The string to encode

Encoding variant: standard (default) or url (URL-safe base64url)

Response Fields

Field Type Description
result string The Base64-encoded output

Code Examples

curl -X POST https://api.requiems.xyz/v1/convert/base64/encode \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": "Hello, world!"}'

# URL-safe variant
curl -X POST https://api.requiems.xyz/v1/convert/base64/encode \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": "Hello, world!", "variant": "url"}'

Error Responses

400

bad_request

Missing or empty value field

422

validation_failed

Validation constraint on the variant field (must be standard or url)

Decode

Decode a Base64-encoded string back to plain text

POST
https://api.requiems.xyz/v1/convert/base64/decode

Parameters

Name Type Required Description
value string Required The Base64-encoded string to decode
variant string Optional Encoding variant: standard (default) or url (URL-safe base64url)

Try it out

Live Demo
Request

The Base64-encoded string to decode

Encoding variant: standard (default) or url (URL-safe base64url)

Response Fields

Field Type Description
result string The decoded plain-text output

Code Examples

curl -X POST https://api.requiems.xyz/v1/convert/base64/decode \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": "SGVsbG8sIHdvcmxkIQ=="}'

# URL-safe variant
curl -X POST https://api.requiems.xyz/v1/convert/base64/decode \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": "SGVsbG8sIHdvcmxkIQ==", "variant": "url"}'

Error Responses

400

bad_request

Missing or empty value field

422

invalid_base64

The value is not valid Base64 and cannot be decoded

Frequently Asked Questions