Conversion Utilities

Liters To Gallons Us

Converts liters to US gallons with precise calculations. Access via MCP in Cursor or Windsurf, or REST API at `/v1/convert/volume/l-to-gal-us`. For example, 10 liters equals 2.641720524 US gallons. Uses the exact conversion factor of 1 liter = 0.264172052 US gallons for deterministic results across all platforms.

API Endpoint

GET /v1/convert/volume/l-to-gal-us

Code Examples

curl "https://tinyfn.io/v1/convert/volume/l-to-gal-us" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/volume/l-to-gal-us', {
  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/volume/l-to-gal-us',
    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 conversion tools:

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

Learn more about MCP setup →

FAQ

How accurate is the liter to US gallon conversion?

Uses the exact conversion factor 1 liter = 0.264172052358 US gallons, providing precision to 12 decimal places for scientific and engineering applications.

What's the difference between US gallons and imperial gallons?

US gallons are smaller: 1 US gallon = 3.785 liters, while 1 imperial gallon = 4.546 liters. This tool specifically converts to US gallons only.

Can I use this in Claude Code or Cursor for batch conversions?

Yes, the MCP integration lets AI agents perform multiple conversions in sequence, perfect for processing fuel consumption data or recipe scaling.

Does the API handle decimal inputs like 2.5 liters?

Absolutely. Accepts any positive decimal value and returns the precise US gallon equivalent with full floating-point precision.

What happens if I pass zero or negative values?

Zero liters returns 0 US gallons. Negative values are handled gracefully but may return an error since volume measurements are typically positive.

Try Liters To Gallons Us Now

Get your free API key and start using Liters To Gallons Us in seconds.

Get Free API Key