Triglyceride-glucose (TyG) index calculator
Fasting triglycerides of 150 mg/dL and glucose of 90 mg/dL give a TyG index of 8.817298, a research marker linked to insulin resistance. All you need are two numbers from a routine fasting panel. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Triglycerides
- 150
- Glucose
- 90
- Tyg index
- 8.817298
- Unit triglycerides
- mg/dL
- Unit glucose
- mg/dL
- Product over two
- 6,750
The triglyceride-glucose index, often shortened to TyG, is a simple offline marker built from two common fasting lab numbers: serum triglycerides and plasma glucose, both expressed in milligrams per deciliter.
What the TyG index measures and what this tool returns
The triglyceride-glucose index was popularized as an accessible surrogate linked to insulin resistance research because both fasting triglycerides and fasting glucose are widely available on routine lipid and metabolic panels. The educational formula used here multiplies the two concentrations in milligrams per deciliter, divides by two, and takes the natural logarithm of that product. Because the logarithm is defined only for positive arguments, both lab values must be strictly greater than zero; zero or negative readings are rejected rather than coerced.
Treat the number as an educational and research-style index, not as a clinical diagnosis of insulin resistance, metabolic syndrome, or diabetes.
Where a TyG calculator earns its keep in study and software
Students meet the triglyceride-glucose index when a metabolism or epidemiology assignment asks them to compute TyG from a printed lipid panel and a fasting glucose, then discuss how the number relates to insulin-resistance literature without claiming a bedside diagnosis. Teachers can pre-generate answer keys for modest lab pairs without trusting opaque apps that silently swap millimoles for milligrams or apply log base ten by mistake.
Developers call the same contract from scripts to seed deterministic test vectors for metabolic dashboards, to normalize user-entered fasting pairs before charting demos, or to satisfy programming-challenge statements that demand TyG rather than a hand-waved interpretation. Research assistants and data stewards use a tiny pure function when cleaning offline CSVs of triglycerides and glucose so every row gets the same ln product formula without opening a spreadsheet plugin that might round differently per locale.
Fitness and education products can surface the index when a learner types two lab values and the UI must show a single comparable score plus the formula string for transparency. Always treat TyG as an educational marker derived from two fasting labs, not as a substitute for clinical assessment, HOMA-IR with insulin, or treatment decisions.
What you can do with it
Classroom and homework checks
Compute TyG from textbook fasting triglyceride and glucose pairs and verify the natural-log formula before grading metabolism worksheets.
Offline data cleaning pipelines
Apply the same ln(TG×glucose/2) formula to CSV rows of fasting labs without network calls or locale-dependent spreadsheet plugins.
FAQ
What units do triglycerides and glucose use?
Both must be in milligrams per deciliter (mg/dL).
What happens if a value is zero or negative?
TyG uses a natural log of a positive product, so both labs must be strictly greater than zero.
Is this a medical diagnosis of insulin resistance?
No. The tool only applies a deterministic educational formula to two fasting lab numbers. It does not diagnose disease or replace clinical care.
What does the TyG index calculator cost?
It is free in your browser on this page.
How is the TyG index calculated?
Multiply fasting triglycerides by fasting glucose, both in mg/dL, divide by two and take the natural logarithm. For 150 and 90 the product over two is 6,750, and its natural log is the index.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/health/tyg-index \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"triglycerides":150,"glucose":90}'const res = await fetch("https://api.kit.forhosting.com/health/tyg-index", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"triglycerides": 150,
"glucose": 90
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/health/tyg-index",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"triglycerides": 150,
"glucose": 90
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/health/tyg-index", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"triglycerides":150,"glucose":90}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"triglycerides":150,"glucose":90}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/health/tyg-index", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"triglycerides": 150,
"glucose": 90
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "health.tyg_index",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Non-positive or missing values fail fast with invalid_input instead of inventing a log of a non-positive product.
What the TyG index measures and what this tool returns
Algebraically that is tyg_index equals ln of triglycerides times glucose over two, which is the same closed form taught in many epidemiology and metabolism methods notes. A successful response echoes the validated triglycerides and glucose numbers, reports product_over_two so you can audit the intermediate step, returns tyg_index rounded to the requested precision, tags unit_triglycerides and unit_glucose as mg/dL, names the method string for provenance, and includes a short formula field you can display next to the result. There is no wearable sync path, no insulin concentration field, and no HOMA-IR path on this endpoint: those are different markers with different inputs.
Input contract, units, precision, and error behaviour
Missing fields, non-finite Infinity or NaN, and non-numeric types are likewise rejected and are not billed. Callers who only have mmol/L labs must convert to mg/dL before calling; this capability does not perform unit conversion, which keeps the contract single-purpose and fully offline. POST a JSON body with two required positive finite numbers: triglycerides for fasting serum triglycerides in mg/dL, and glucose for fasting plasma glucose in mg/dL. Aliases are accepted so spreadsheets and typed forms can reuse the same contract: tg, triglyceride, trig, and triglycerides_mg_dl map to triglycerides; fasting_glucose, glu, glc, and glucose_mg_dl map to glucose. String decimals with optional leading plus and scientific notation are allowed when they parse as finite numbers; blank strings, hex tokens, and non-numeric junk fail with a clear invalid_input message naming the field. On success you receive triglycerides, glucose, tyg_index, unit_triglycerides, unit_glucose, product_over_two, method, precision, and formula. Example: triglycerides one hundred fifty and glucose ninety yield product_over_two of six thousand seven hundred fifty and a TyG near eight point eight one seven. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing Math.log and the product check yourself.
Where a TyG calculator earns its keep in study and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible TyG values and product_over_two intermediates for unit tests, property checks, and CI assertions.
Technical questions
How is the triglyceride-glucose (TyG) index calculated?
TyG equals the natural logarithm of fasting triglycerides in mg/dL times fasting glucose in mg/dL divided by two: tyg_index = ln(triglycerides × glucose / 2).