Encoding Utilities

Base64 Encode

Converts any text string into base64-encoded format with proper Unicode handling. Use via MCP in AI coding assistants like Cursor and Windsurf, or call REST endpoint `/v1/encode/base64/encode`. Perfect for encoding API keys, embedding binary data in JSON, or preparing content for web transmission. Handles emojis and international characters correctly.

API Endpoint

GET /v1/encode/base64/encode

Code Examples

curl "https://tinyfn.io/v1/encode/base64/encode" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/encode/base64/encode', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/encode/base64/encode',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's encoding tools:

{
  "mcpServers": {
    "tinyfn-encoding": {
      "url": "https://tinyfn.io/mcp/encoding",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How does base64 encoding handle Unicode and special characters?

The tool properly UTF-8 encodes Unicode characters before base64 conversion, ensuring emojis, accented letters, and international text encode correctly without data loss.

Can I use this MCP tool in Cursor to encode sensitive data like API keys?

Yes, MCP tools in Cursor can encode API keys to base64 format. However, base64 is encoding not encryption — it's easily reversible and provides no security protection.

What's the REST API format for base64 encoding text?

Send GET request to `/v1/encode/base64/encode` with your text as a query parameter. Returns JSON response with the base64-encoded result.

Why use a deterministic base64 tool instead of built-in functions?

Eliminates inconsistent AI hallucination of base64 results. Guarantees accurate encoding every time, especially important for data integrity in production workflows.

Does base64 encoding increase the size of my original text?

Yes, base64 encoding increases size by approximately 33%. Every 3 bytes become 4 characters, plus padding characters when needed.

Try Base64 Encode Now

Get your free API key and start using Base64 Encode in seconds.

Get Free API Key