Optimization Guide

Ecommerce Product Weight and Dimensions Schema for AI Shopping Agents

Size-constrained queries — "carry-on luggage under 22 inches", "dumbbells under 50 lbs", "desk lamp under 18 inches tall" — require machine-readable physical dimension data to resolve correctly. If your product dimensions live only in description text, AI agents cannot match them against numeric constraints.

TL;DR Use schema.org's dedicated weight, width, height, and depth properties with QuantitativeValue objects and UN/CEFACT unitCode values. These allow AI agents to perform numeric comparisons against size constraints in user queries. Description-text dimensions ("24 inches wide") are parsed by NLP but with lower reliability than structured data — and they cannot be compared mathematically.

Why Physical Dimensions Matter for AI Agent Matching

When a user asks an AI shopping agent for "a suitcase that fits in an overhead bin" or "a microwave under 18 inches wide for a studio kitchen", the agent needs to perform a numeric constraint match: does this product's width value fall below 18 inches? This requires the dimension to exist as a structured, unit-aware numeric value — not buried in a paragraph of description text.

Text parsing can extract "18 inches wide" from a description, but it cannot reliably:

Schema.org's dimension properties solve all four problems with explicit axis labels, unit codes, and numeric values that AI agents can compare directly.

Core Schema.org Dimension Properties

The schema.org Product type has four built-in physical property fields:

PropertyAxis / meaningAccepted type
weightProduct weight (not shipping weight)QuantitativeValue
widthHorizontal span (left to right)QuantitativeValue or Distance
heightVertical span (bottom to top)QuantitativeValue or Distance
depthFront-to-back span (note: not "length")QuantitativeValue or Distance

Note: schema.org does not have a length property on Product. Use depth for the front-to-back or longest dimension. For products where "length" is the primary dimension (e.g., a rope, a cable, a board), use depth with an explicit unitText label, or use additionalProperty with propertyID: "length".

UN/CEFACT Unit Codes Reference

The unitCode field on QuantitativeValue uses UN/CEFACT Recommendation 20 codes. Use these for maximum AI agent compatibility:

MeasurementUnitunitCode
WeightGramsGRM
WeightKilogramsKGM
WeightPoundsLBR
WeightOunces (avoirdupois)ONZ
DimensionMillimetersMMT
DimensionCentimetersCMT
DimensionMetersMTR
DimensionInchesINH
DimensionFeetFOT
VolumeMillilitersMLT
VolumeLitersLTR
VolumeFluid ounces (US)OZA

Full JSON-LD Example: Carry-On Luggage

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Hardshell Carry-On Spinner — 22\" Cabin Max",
  "weight": {
    "@type": "QuantitativeValue",
    "value": 3.2,
    "unitCode": "KGM",
    "unitText": "kg"
  },
  "width": {
    "@type": "QuantitativeValue",
    "value": 38,
    "unitCode": "CMT",
    "unitText": "cm"
  },
  "height": {
    "@type": "QuantitativeValue",
    "value": 56,
    "unitCode": "CMT",
    "unitText": "cm"
  },
  "depth": {
    "@type": "QuantitativeValue",
    "value": 22,
    "unitCode": "CMT",
    "unitText": "cm"
  },
  "additionalProperty": [
    {
      "@type": "PropertyValue",
      "propertyID": "dimensions",
      "name": "Dimensions (W × H × D)",
      "value": "38 × 56 × 22 cm (15\" × 22\" × 8.7\")"
    },
    {
      "@type": "PropertyValue",
      "propertyID": "shippingWeight",
      "name": "Shipping Weight (packaged)",
      "value": "3.8 kg"
    },
    {
      "@type": "PropertyValue",
      "propertyID": "cabinCompliant",
      "name": "Cabin Carry-On Compliant",
      "value": "IATA standard: 56 × 45 × 25 cm — this bag qualifies"
    }
  ]
}

Desk organizer with capacity volume

{
  "@type": "Product",
  "name": "Bamboo Desk Organizer — 5 Compartment",
  "width": { "@type": "QuantitativeValue", "value": 24, "unitCode": "CMT", "unitText": "cm" },
  "height": { "@type": "QuantitativeValue", "value": 10, "unitCode": "CMT", "unitText": "cm" },
  "depth": { "@type": "QuantitativeValue", "value": 14, "unitCode": "CMT", "unitText": "cm" },
  "weight": { "@type": "QuantitativeValue", "value": 420, "unitCode": "GRM", "unitText": "g" },
  "additionalProperty": {
    "@type": "PropertyValue",
    "propertyID": "dimensions",
    "value": "24 × 10 × 14 cm (9.4\" × 3.9\" × 5.5\")"
  }
}

Shopify Liquid Implementation

Shopify stores weight in the variant weight field (accessible as variant.weight in grams). Dimensions require a product metafield. Recommended metafield structure:

{% comment %}
  Metafields (all in namespace 'dimensions'):
  - width_cm   (number_decimal)
  - height_cm  (number_decimal)
  - depth_cm   (number_decimal)
{% endcomment %}

{% assign v = product.selected_or_first_available_variant %}
{% assign weight_kg = v.weight | divided_by: 1000.0 %}

"weight": {
  "@type": "QuantitativeValue",
  "value": {{ weight_kg }},
  "unitCode": "KGM",
  "unitText": "kg"
},

{% if product.metafields.dimensions.width_cm %}
"width": {
  "@type": "QuantitativeValue",
  "value": {{ product.metafields.dimensions.width_cm }},
  "unitCode": "CMT",
  "unitText": "cm"
},
"height": {
  "@type": "QuantitativeValue",
  "value": {{ product.metafields.dimensions.height_cm }},
  "unitCode": "CMT",
  "unitText": "cm"
},
"depth": {
  "@type": "QuantitativeValue",
  "value": {{ product.metafields.dimensions.depth_cm }},
  "unitCode": "CMT",
  "unitText": "cm"
},
{% endif %}

Dimension Markup by Product Category

Prioritize dimension markup for categories where size is a primary purchase qualifier:

CategoryCritical dimensionsCommon size-constrained queries
Luggage / bags Width, height, depth, weight "carry-on under 22 inches", "personal item bag under 40×20×25cm"
Furniture Width, height, depth "desk under 120cm wide", "bookshelf under 80cm tall"
Appliances (small) Width, height, depth "microwave under 18 inches wide", "air fryer under 12 inches tall"
Fitness equipment Weight (barbells/dumbbells), dimensions (benches/racks) "dumbbells under 50 lbs", "weight bench under 50 inches"
Storage containers All three + volume capacity "under-bed storage box under 8 inches tall", "6 quart container"
Electronics Weight (laptops/tablets), dimensions (monitors/TVs) "laptop under 4 pounds", "27-inch monitor depth under 3 inches"

Product vs. Shipping Dimensions

AI agents matching size constraints are looking for product dimensions — the physical size of the item itself, not the shipping box. Use schema.org's weight/width/height/depth for product dimensions, and additionalProperty for shipping dimensions:

"additionalProperty": [
  {
    "@type": "PropertyValue",
    "propertyID": "shippingWeight",
    "name": "Shipping Weight (packaged)",
    "value": "3.8 kg"
  },
  {
    "@type": "PropertyValue",
    "propertyID": "shippingDimensions",
    "name": "Shipping Box Dimensions",
    "value": "42 × 60 × 28 cm"
  }
]

Shopify's shipping weight (the value you set in product variants for shipping calculations) is the packaged weight. If you need to expose the bare product weight, store it in a dimensions.product_weight_kg metafield.

Weight and Dimensions Markup Checklist

  1. Create metafields in Shopify Admin: dimensions.width_cm, dimensions.height_cm, dimensions.depth_cm (number_decimal type)
  2. Populate metafields for all products where size is a purchase qualifier (prioritize luggage, furniture, appliances, fitness, storage)
  3. Add weight to your Product JSON-LD using variant.weight (already stored in Shopify in grams — divide by 1000 for KGM)
  4. Add width, height, depth from metafields with unitCode: "CMT"
  5. Add an additionalProperty with propertyID: "dimensions" and a human-readable dual-unit string for NLP fallback
  6. Use additionalProperty for shipping weight and shipping box dimensions — keep separate from product dimensions
  7. For volume-critical products (containers, bottles), add additionalProperty with propertyID: "capacityVolume"
  8. Validate JSON-LD with Google's Rich Results Test after Liquid template changes
  9. Ping IndexNow with updated product URLs

Related Resources

Frequently Asked Questions

What schema.org properties should I use for product weight?

Use the weight property on your Product type, with a QuantitativeValue object. Include value (numeric), unitCode (KGM for kilograms, LBR for pounds, GRM for grams, ONZ for ounces), and unitText (display string). For packaged shipping weight, use additionalProperty with propertyID: "shippingWeight" so AI agents know to use the product weight for size-constraint matching.

How do I mark up product dimensions (length, width, height) in schema.org?

Schema.org provides width, height, and depth on the Product type. Each takes a QuantitativeValue with value and unitCode (CMT for centimeters, INH for inches). Note: schema.org uses depth not "length" for the front-to-back dimension. Add an additionalProperty with propertyID: "dimensions" and a human-readable dual-unit string for NLP fallback.

Do AI shopping agents filter by product weight and dimensions?

Yes, in size-constrained categories. Queries like "carry-on under 22 inches", "laptop under 4 pounds", "desk under 120cm wide" require numeric matching against structured dimension data. Products without machine-readable dimension markup are excluded from these filtered results even if dimensions appear in the description — because text dimensions cannot be reliably compared against numeric query constraints.

Should I use metric or imperial units in schema.org?

Use your primary market's units in the schema.org dimension fields, with the correct UN/CEFACT unitCode. Then add an additionalProperty with a human-readable dual-unit string (e.g., "24\" / 61 cm") for cross-market NLP coverage. The unitCode lets AI agents perform unit conversions internally — a weight of 2.5 with unitCode: "KGM" is unambiguous and convertible to pounds automatically.

Audit Physical Attribute Coverage Across Your Catalog

CatalogScan scans your product catalog for missing weight and dimension signals, incorrect unit codes, and physical attribute markup gaps — then ranks them by impact on size-filtered AI agent query coverage.

Scan your store free