Diabetes Tech Lab

MARD Calculator

Mean Absolute Relative Difference (MARD) is the standard metric for assessing CGM accuracy. A lower percentage means the sensor readings are closer to your reference blood glucose.

Input Data

Enter paired readings. For best results, wait at least 15 minutes after eating or bolusing to avoid interstitial fluid lag.

  <div id="calculator-app">
    <!-- Will be mounted via JS, but we provide structural HTML for clarity -->
    <form id="mard-form" class="space-y-4">
      <div id="input-rows" class="space-y-2">
        <div class="flex gap-4 items-end">
          <div class="flex-1">
            <label for="bg-1" class="block text-sm font-bold mb-1">Blood Glucose (mg/dL)</label>
            <input type="number" id="bg-1" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite" required>
          </div>
          <div class="flex-1">
            <label for="cgm-1" class="block text-sm font-bold mb-1">CGM Reading (mg/dL)</label>
            <input type="number" id="cgm-1" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite" required>
          </div>
        </div>
        <div class="flex gap-4 items-end">
          <div class="flex-1">
            <label for="bg-2" class="block text-sm font-bold mb-1">Blood Glucose (mg/dL)</label>
            <input type="number" id="bg-2" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite">
          </div>
          <div class="flex-1">
            <label for="cgm-2" class="block text-sm font-bold mb-1">CGM Reading (mg/dL)</label>
            <input type="number" id="cgm-2" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite">
          </div>
        </div>
        <div class="flex gap-4 items-end">
          <div class="flex-1">
            <label for="bg-3" class="block text-sm font-bold mb-1">Blood Glucose (mg/dL)</label>
            <input type="number" id="bg-3" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite">
          </div>
          <div class="flex-1">
            <label for="cgm-3" class="block text-sm font-bold mb-1">CGM Reading (mg/dL)</label>
            <input type="number" id="cgm-3" class="w-full p-2 border-2 border-black focus:border-blood outline-none bg-offwhite">
          </div>
        </div>
      </div>
      <div class="flex gap-4 pt-4">
        <button type="button" id="add-row-btn" class="px-4 py-2 border-2 border-black hover:bg-black hover:text-offwhite font-bold transition-colors">Add Row</button>
        <button type="submit" class="px-4 py-2 bg-blood text-offwhite font-bold border-2 border-blood hover:bg-black hover:border-black transition-colors flex-1">Calculate MARD</button>
      </div>
    </form>
  </div>
</div>

<div>
  <h2 class="text-3xl font-bold mb-4">Results</h2>
  <div class="bg-black text-offwhite p-8 brutalist-border h-full flex flex-col justify-center items-center text-center">
    <div id="result-display" class="w-full">
      <p class="text-gray mb-2">Calculated MARD</p>
      <div class="text-7xl font-black text-blood mb-4" id="mard-value">--%</div>
      <p class="text-sm px-4" id="mard-context">Enter at least one pair of readings to calculate.</p>
    </div>
  </div>
</div>

FAQ & Common Mistakes

Why is my personal MARD higher than the manufacturer claims?

Manufacturers calculate MARD in controlled clinical environments across hundreds of participants. They often exclude data from the first 12-24 hours (when sensors are least accurate) and ensure participants are well-hydrated. Your real-world MARD includes day 1 inaccuracies, compression lows, and rapid fluctuations.

When should I test?

Do not test during rapid changes (e.g., arrows up or down). Interstitial fluid lags behind blood glucose by 5-15 minutes. To get an accurate comparison, test when your glucose has been steady for at least 15 minutes.