Number Utilities

Base Convert

Converts numbers between bases 2-36 with precise calculations for hex, binary, octal conversions. Use via MCP in Cursor or Windsurf for instant base conversion during development, or hit `/v1/number/base-convert` with value, source base, and target base parameters. Returns exact string representation without floating-point errors that plague manual calculations.

API Endpoint

GET /v1/number/base-convert

Code Examples

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

response = requests.get('https://tinyfn.io/v1/number/base-convert',
    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 number tools:

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

Learn more about MCP setup →

FAQ

How do I convert hexadecimal to binary using base convert?

Set source base to 16, target base to 2, and pass your hex value. For example, 'FF' in base 16 becomes '11111111' in base 2.

What's the maximum base supported for number conversion?

Supports bases 2 through 36, using digits 0-9 and letters A-Z for values above 9. Base 36 uses all alphanumeric characters.

Can I use base convert in MCP tools like Claude Code for quick calculations?

Yes, the MCP tool provides instant base conversion in your IDE without switching contexts or opening calculators.

Does base convert handle large numbers accurately?

Yes, it uses string-based arithmetic to avoid JavaScript's floating-point limitations, ensuring precise conversion of large integers.

What happens if I pass an invalid digit for the source base?

Returns an error if the input contains digits not valid for the specified base (like '8' in base 8 or 'G' in base 16).

Try Base Convert Now

Get your free API key and start using Base Convert in seconds.

Get Free API Key