Calculators
Gross / operating / net margins API
Gross margin = (revenue - COGS)/revenue, plus operating margin and net margin from an income-statement slice — the standard profitability ladder. Answers 'what's my gross margin', 'what's my operating margin', 'what's my net profit margin'.
Price$0.01per request
MethodPOST
Route/v1/calc/biz-profit-margins
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calcmarginsgross-marginoperating-marginnet-marginprofitabilityopsfinance
API URL
Integration docshttps://x402.hexl.dev/v1/calc/biz-profit-marginsExample request
{
"revenue": 500000,
"cogs": 300000,
"operatingExpenses": 120000,
"netIncome": 60000
}Example response
{
"formula": "grossMargin = (revenue - COGS) / revenue",
"grossProfit": 200000,
"grossMarginPercent": 40,
"inputs": {
"revenue": 500000,
"cogs": 300000
},
"operatingExpenses": 120000,
"operatingIncome": 80000,
"operatingMarginPercent": 16,
"netIncome": 60000,
"netMarginPercent": 12,
"rating": "moderate"
}Input schema
{
"type": "object",
"required": [
"revenue",
"cogs"
],
"properties": {
"revenue": {
"type": "number",
"examples": [
500000
]
},
"cogs": {
"type": "number",
"examples": [
300000
]
},
"operatingExpenses": {
"type": "number",
"examples": [
120000
]
},
"netIncome": {
"type": "number",
"examples": [
60000
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}