Converts plain text strings into hexadecimal representation using UTF-8 encoding. Access via MCP in Cursor or Windsurf, or call GET /v1/encode/hex/encode directly. Example: "hello" becomes "68656c6c6f". Each byte maps to two hex characters, making it useful for data transmission and debugging binary content in AI workflows.
curl "https://tinyfn.io/v1/encode/hex/encode" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/encode/hex/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/hex/encode',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Uses UTF-8 encoding first, then converts each byte to hex. A character like 'é' becomes 'c3a9' (two bytes in UTF-8).
Hex uses 0-9 and a-f characters with 2:1 expansion ratio, while Base64 uses 64 characters with ~4:3 ratio. Hex is more readable but less efficient.
Yes, hex encoding is perfect for representing binary data as text that AI models can process without corruption or interpretation issues.
Use the corresponding hex decode tool or reverse the process: convert hex pairs back to bytes, then decode UTF-8 to get original text.
Empty string returns empty hex. Spaces and newlines encode normally: space becomes '20', newline becomes '0a'.