{
  "id": "mg-to-grams",
  "version": "b7f75fea5d42",
  "status": "published",
  "name": "Mg to Grams Converter",
  "question": "Convert mg to grams",
  "summary": "Converts milligrams (mg) to grams (g) and back, with the exact unit definitions.",
  "category": "convert",
  "subcategory": "weight",
  "url": "https://www.acalculator.org/convert/mg-to-grams",
  "markdown": "https://www.acalculator.org/convert/mg-to-grams.md",
  "kind": "formulas",
  "method": "g = mg × 0.001",
  "assumptions": [
    "1 milligram = 0.001 grams, from the exact definitions in NIST SP 811.",
    "Exact on the typed decimals: at most 6 decimal places (6 significant digits below 0.0001), rounded half up; an answer of 1 billion or more shows at most 15 significant digits."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "value": {
        "title": "Milligrams (mg)",
        "description": "The amount in milligrams to convert.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "result": {
        "title": "Grams (g)",
        "description": "The same amount in grams.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000
      }
    }
  },
  "solve": {
    "fillAny": 1,
    "variables": [
      "value",
      "result"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "value": {
      "label": "Milligrams (mg)",
      "description": "The amount in milligrams to convert.",
      "format": "number"
    },
    "result": {
      "label": "Grams (g)",
      "description": "The amount in grams.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "value": 1
    },
    "outputs": {
      "result": 0.001
    },
    "text": "1 mg = 0.001 g."
  },
  "examples": [
    {
      "given": {
        "value": 1
      },
      "expect": {
        "result": 0.001
      },
      "source": "exact unit definitions in NIST SP 811 (2008), Appendix B.8"
    },
    {
      "given": {
        "value": 500
      },
      "expect": {
        "result": 0.5
      },
      "source": "exact unit definitions in NIST SP 811 (2008), Appendix B.8"
    },
    {
      "given": {
        "result": 0.5
      },
      "expect": {
        "value": 500
      },
      "source": "exact unit definitions in NIST SP 811 (2008), Appendix B.8"
    }
  ],
  "sources": [
    "NIST SP 811 (2008), Chapter 4, Table 5: SI prefixes (kilo 10³, centi 10⁻², milli 10⁻³), retrieved 2026-10-18. https://www.nist.gov/pml/special-publication-811/nist-guide-si-chapter-4-two-classes-si-units-and-si-prefixes"
  ],
  "related": [
    "grams-to-kg",
    "kg-to-grams",
    "mg-to-kg",
    "kg-to-mg",
    "grams-to-oz"
  ],
  "changelog": []
}
