{
  "id": "grams-to-cups",
  "version": "939419478a0c",
  "status": "published",
  "name": "Grams to Cups Converter",
  "question": "How do I convert grams to cups?",
  "summary": "Converts grams to cups and back for a baking ingredient, with USDA weights for one level US cup.",
  "category": "convert",
  "subcategory": "cooking",
  "url": "https://www.acalculator.org/convert/grams-to-cups",
  "markdown": "https://www.acalculator.org/convert/grams-to-cups.md",
  "kind": "formulas",
  "method": "cups = grams ÷ grams per cup, where grams per cup depends on the ingredient (all-purpose flour: 125 g).",
  "assumptions": [
    "Grams per cup are USDA FoodData Central (SR Legacy) portion weights for one level US cup (8 US fluid ounces): all-purpose flour 125 g (FDC 168894), granulated sugar 200 g (FDC 169655), brown sugar, packed 220 g (FDC 168833), powdered sugar, unsifted 120 g (FDC 169656).",
    "How you fill the cup changes the weight: packed, sifted, or scooped flour can differ by 20% or more.",
    "The answer shows at most 6 decimal places; the calculation keeps full precision."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "value": {
        "title": "Grams (g)",
        "description": "The amount in grams to convert.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000000000000
      },
      "result": {
        "title": "Cups (cup)",
        "description": "The same amount in cups.",
        "type": "number",
        "minimum": 0,
        "maximum": 8333333333.333333
      },
      "ingredient": {
        "title": "Ingredient",
        "description": "What you are measuring. A cup of flour weighs less than a cup of sugar.",
        "type": "string",
        "enum": [
          "flour",
          "sugar",
          "brown-sugar",
          "powdered-sugar"
        ]
      }
    }
  },
  "solve": {
    "fillAny": 1,
    "variables": [
      "value",
      "result"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "value": {
      "label": "Grams (g)",
      "description": "The amount in grams to convert.",
      "format": "number"
    },
    "result": {
      "label": "Cups (cup)",
      "description": "The amount in cups.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "ingredient": "flour",
      "value": 250
    },
    "outputs": {
      "result": 2
    },
    "text": "250 g = 2 cup."
  },
  "examples": [
    {
      "given": {
        "value": 250,
        "ingredient": "flour"
      },
      "expect": {
        "result": 2
      },
      "source": "USDA FoodData Central SR Legacy 168894: 1 cup = 125 g"
    },
    {
      "given": {
        "value": 100,
        "ingredient": "sugar"
      },
      "expect": {
        "result": 0.5
      },
      "source": "USDA FoodData Central SR Legacy 169655: 1 cup = 200 g"
    }
  ],
  "sources": [
    "USDA FoodData Central, SR Legacy portion weights for 1 cup: FDC 168894 all-purpose flour 125 g; FDC 169655 granulated sugar 200 g; FDC 168833 brown sugar, packed 220 g; FDC 169656 powdered sugar, unsifted 120 g. https://fdc.nal.usda.gov/",
    "NIST SP 811 (2008), Guide for the Use of the International System of Units, Appendix B.8. https://www.nist.gov/pml/special-publication-811"
  ],
  "related": [
    "cups-to-grams",
    "oz-to-cups",
    "tablespoons-to-cups",
    "ml-to-cups",
    "quarts-to-cups"
  ],
  "changelog": []
}
