Converts raw byte counts into readable storage formats like "1.2 GB" or "512 MB". Access via MCP in Cursor or Windsurf, or REST at /v1/convert/data/bytes-to-human. Perfect for file size displays, memory usage reports, or bandwidth calculations. Handles up to exabytes with configurable decimal precision.
curl "https://tinyfn.io/v1/convert/data/bytes-to-human" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/data/bytes-to-human', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/convert/data/bytes-to-human',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's conversion tools:
{
"mcpServers": {
"tinyfn-conversion": {
"url": "https://tinyfn.io/mcp/conversion",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Use the MCP tool in Claude or Cursor, or call GET /v1/convert/data/bytes-to-human?bytes=1073741824. Returns formatted strings like '1.0 GB' with appropriate units.
Binary uses 1024-based units (1 KB = 1024 bytes), decimal uses 1000-based (1 kB = 1000 bytes). Most file systems use binary, web contexts often use decimal.
Yes, specify precision parameter to control decimal places. Default is 1 decimal place, but you can set 0 for whole numbers or 2+ for more precision.
Supports up to exabyte range (10^18 bytes). Automatically selects appropriate unit from bytes, KB, MB, GB, TB, PB, EB based on input size.
Convert raw byte counts from upload APIs into user-friendly displays. Instead of showing '2847392 bytes uploaded', display '2.7 MB uploaded' for better UX.
Get your free API key and start using Bytes To Human in seconds.
Get Free API Key