Converts raw byte counts into human-readable formats like "2.5 GB" or "847 KB". Use via MCP in Cursor or Windsurf, or call GET /v1/format/bytes with your byte value. Perfect for file size displays, storage calculations, or bandwidth reporting. Returns standardized units following binary (1024) or decimal (1000) conventions.
curl "https://tinyfn.io/v1/format/bytes" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/format/bytes', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/format/bytes',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's formatting tools:
{
"mcpServers": {
"tinyfn-format": {
"url": "https://tinyfn.io/mcp/format",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Call the format_bytes tool with your byte count. It returns formatted strings like '1.5 GB' or '512 MB' with appropriate unit scaling.
Most implementations use binary units (1024 bytes = 1 KB) by default, matching how operating systems typically display file sizes.
Supports values up to petabytes and beyond, handling both integer and floating-point inputs for precise storage calculations.
Yes, most formatters allow precision control. Small files show exact bytes, larger files typically round to 1-2 decimal places for readability.
Agents use it to display file sizes, calculate storage requirements, or report progress during data processing tasks with user-friendly units.
Get your free API key and start using Format Bytes in seconds.
Get Free API Key