Find a variant ID
Variant IDs are sometimes needed to make theme code customizations that target specific product variants, or for reconciling migration or bulk product update information with a third-party app. If you need to find a variant ID, then you can do so from within your Shopify admin.
On this page
Find a variant ID for a product with variants
If a product has variants, such as different colors, sizes, or styles, then the variant ID is displayed in the browser address bar as part of the URL. This can be a quick way to determine the variant ID for an individual variant.
Steps:
From your Shopify admin, go to Products.
Click a product that has a variant.
In the Variants section, click the product variant that you want to view the product variant ID for.
Examine the URL in your browser's address bar. Your URL should be similar to the following URL example:
https://admin.shopify.com/store/shopname/products/1234567/variants/36485954240671The number after /variants/ is the variant ID number. In this example, the variant ID is 36485954240671.
Find a variant ID for a product without variants
A product that has no variants still has a variant ID assigned to it. However, unlike a product with variants, the variant ID doesn't display in the browser address bar when you access the product details page from the Shopify admin.
You can access the variant ID for a product by displaying the complete product information in JSON format. This can be a quick way to determine the variant ID for an individual product.
To make the JSON formatting more readable, consider installing a JSON viewer extension in your browser, or leveraging the pretty-print capability that most modern web browsers have available by default.
Steps:
From your Shopify admin, go to Products.
Click a product that you want to find the variant ID for to open the product details page.
In the browser address bar, add
.jsonto the end of the URL and hitEnterto reload the page in JSON.Optional: If you don't have a JSON viewer extension installed, then activate the Pretty-print setting on the webpage to reformat the JSON file to be more user-friendly.
Locate the
"product" > "variants" > "id"value. The beginning of the JSON file displays similar to the following example:
{
"product": {
"id": 12345678901234,
"title": "Example Product",
"body_html": "<p>This is an example product.</p>",
"vendor": "Example Vendor",
"product_type": "Test Items",
"created_at": "2025-07-09T12:40:46-04:00",
"handle": "example-product",
"updated_at": "2025-07-09T12:40:50-04:00",
"published_at": "2025-07-09T12:40:47-04:00",
"template_suffix": "",
"published_scope": "global",
"tags": "demo, test",
"status": "active",
"admin_graphql_api_id": "gid://shopify/Product/12345678901234",
"variants": [
{
"id": 11223344556677,
"product_id": 12345678901234,
"title": "Default Title",
"price": "30.00",
......}
.....]
....}
...}In the example above, 11223344556677 is the product's variant ID.
Display variant IDs in bulk in a custom inventory report
The Product variant ID dimension is available to use in custom data explorations. This can be a useful way to display variant IDs for many products on a single report, and can be saved, printed, or exported. This data exploration includes all products by default, including draft products, but you can choose to filter the report to display only a subset of products.
Learn more about creating custom data explorations.
Steps:
From your Shopify admin, go to Analytics > Reports.
Click New exploration.
In the Metrics menu, apply the primary metric:
- Click ⊕.
- Select Percent of inventory sold.
- Click Apply.
In the Dimensions menu, apply the required dimensions:
- Click ⊕.
- Select Product title, Product variant title, and Product variant ID.
- Click Apply.
Optional: In the Filters menu, apply any filters to display a subset of products:
- To display only products with no variants, apply the filter
Product variant title > is > Default Title. - To display only products with variants, apply the filter
Product variant title > is not > Default Title.
- To display only products with no variants, apply the filter
Optional: To save this data exploration as a custom report for later use, do the following actions:
- Click Save.
- In the Save report dialog, give your custom report a name, such as Product list including variant IDs.
- Click Save.
Optional: To export this data exploration, click
> Export. Select your preferred export file format, and then click Export.
You can now read and record the variant IDs for all products displayed in the report.