ASCII to Text API: The Complete Guide

Need to convert ASCII codes to readable text? This guide covers everything you need to know about ASCII to text conversion via API, including different input formats and encoding considerations.

What is ASCII?

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numbers to characters. Each character has a unique code from 0 to 127. For example, 'A' is 65, 'a' is 97, and '0' is 48.

Example: The codes 72 101 108 108 111 convert to "Hello"

ASCII Code Reference

Common ASCII values:

  • 0-31: Control characters (non-printable)
  • 32: Space
  • 48-57: Digits 0-9
  • 65-90: Uppercase A-Z
  • 97-122: Lowercase a-z
Note: Extended ASCII (128-255) includes additional characters but isn't standardized across all systems.

Using the ASCII to Text API

TinyFn provides a simple endpoint to convert ASCII codes:

API Request
POST https://api.tinyfn.io/v1/text/ascii-to-text
Headers: X-API-Key: your-api-key
Content-Type: application/json

{
  "ascii": "72 101 108 108 111",
  "separator": " "
}
Response
{
  "text": "Hello",
  "character_count": 5,
  "codes_processed": 5
}

Parameters

Parameter Type Description
ascii string ASCII codes to convert (required)
separator string Separator between codes (default: space)
format string Input format: decimal, hex, binary (default: decimal)

Code Examples

JavaScript / Node.js

const response = await fetch(
  'https://api.tinyfn.io/v1/text/ascii-to-text',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      ascii: '72 101 108 108 111',
      separator: ' '
    })
  }
);
const result = await response.json();
console.log(result.text); // "Hello"

Python

import requests

response = requests.post(
    'https://api.tinyfn.io/v1/text/ascii-to-text',
    headers={'X-API-Key': 'your-api-key'},
    json={'ascii': '72 101 108 108 111', 'separator': ' '}
)
result = response.json()
print(result['text'])  # "Hello"

cURL

curl -X POST "https://api.tinyfn.io/v1/text/ascii-to-text" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"ascii": "72 101 108 108 111"}'

Common Use Cases

  • Data Decoding: Convert encoded data back to text
  • Educational Tools: Teach character encoding concepts
  • CTF Challenges: Solve encoding puzzles
  • Legacy Systems: Interface with ASCII-based protocols
  • Debugging: Inspect byte-level text data

Best Practices

  1. Validate input: Ensure ASCII codes are in valid range (0-127)
  2. Handle separators: Support common separators (space, comma)
  3. Support formats: Accept decimal, hex, and binary input
  4. Handle errors: Gracefully handle invalid codes

Use via MCP

Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:

{
  "mcpServers": {
    "tinyfn-text": {
      "url": "https://api.tinyfn.io/mcp/text/",
      "headers": {
        "X-API-Key": "your-api-key"
      }
    }
  }
}

See all text analysis tools available via MCP in our Text Analysis MCP Tools for AI Agents guide.

Try the ASCII to Text API

Get your free API key and start converting ASCII in seconds.

Get Free API Key

Ready to try TinyFn?

Get your free API key and start building in minutes.

Get Free API Key