Base64 Encoder/Decoder

Base64 Encoder/Decoder API

Development

Encode and decode text and images to and from Base64 format.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

100 requests per minute

Endpoints

1 endpoint available

Overview

The Base64 Encoder/Decoder API converts text and images to and from Base64 format. Supports both encoding (text/image to Base64) and decoding (Base64 to text/image).

Operations

  • encode - Convert text or image data to Base64
  • decode - Convert Base64 back to text or image

Input Types

  • text - Plain text strings (UTF-8 supported)
  • image - Base64-encoded image data or data URLs

Use Cases

  • Embed images in HTML/CSS as data URIs
  • Encode data for URL parameters
  • Convert images for email signatures
  • Transmit binary data over text-based protocols
  • Store binary data in JSON

Endpoints

POST
/v1/tools/base64-encoder-decoder
Encode or decode text/images to/from Base64

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
operation
string
Enum: encode, decode
Required
The operation to perform
type
string
Enum: text, image
Required
The type of data being processed
input
string
Required
The input data (text to encode, Base64 to decode, or image data URL)

Response Example

{
  "success": true,
  "result": {
    "output": "SGVsbG8gV29ybGQh",
    "operation": "encode",
    "type": "text"
  }
}

Error Codes

400
Invalid request body or missing required fields
401
Missing or invalid API key
422
Invalid Base64 string or unsupported format
429
Rate limit exceeded
500
Internal server error

Code Examples

# Encode text to Base64
curl -X POST https://api.opentools.ca/v1/tools/base64-encoder-decoder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation": "encode", "type": "text", "input": "Hello World!"}'

# Decode Base64 to text
curl -X POST https://api.opentools.ca/v1/tools/base64-encoder-decoder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation": "decode", "type": "text", "input": "SGVsbG8gV29ybGQh"}'

Ready to get started?

Create an API key to start using the Base64 Encoder/Decoder API.