Conversion Utilities

Ounces To Grams

Converts ounces to grams with precise multiplication by 28.34952 factor. Access via MCP in Cursor or Windsurf for weight calculations, or call GET /v1/convert/weight/oz-to-g?oz=5 directly. Returns exactly 141.7476 grams for 5 ounces. Uses standard avoirdupois ounce definition for cooking, shipping, and scientific applications.

API Endpoint

GET /v1/convert/weight/oz-to-g

Code Examples

curl "https://tinyfn.io/v1/convert/weight/oz-to-g" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/weight/oz-to-g', {
  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/weight/oz-to-g',
    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

What's the exact conversion factor from ounces to grams?

1 ounce equals exactly 28.34952 grams using the international avoirdupois definition.

How do I convert ounces to grams in my AI coding assistant?

Use the MCP tool in Cursor, Windsurf, or Claude Code by calling the ounces-to-grams function with your value.

Does this handle fractional ounces accurately?

Yes, it accepts decimal inputs like 2.5 oz and returns precise gram calculations without rounding errors.

What's the difference between troy ounces and regular ounces for conversion?

This tool uses avoirdupois ounces (28.35g), not troy ounces (31.10g) used for precious metals.

Can I batch convert multiple ounce values at once?

The API accepts single values per request - make multiple calls for batch conversions or use in loops.

Try Ounces To Grams Now

Get your free API key and start using Ounces To Grams in seconds.

Get Free API Key