Utility

Google Sheets IMAGE Function — Syntax, Examples & Tips

Learn how to use the IMAGE function in Google Sheets to insert images from URLs directly into cells. Includes syntax, sizing modes, and practical examples.

Syntax
=IMAGE(url, [mode], [height], [width])

What Is the IMAGE Function?

IMAGE inserts an image into a cell using a URL. The image lives inside the cell and resizes with it, which means you can build visual product catalogs, dashboards with icons, or flag-based country lists without manually inserting images one by one. The function supports PNG, JPG, GIF, and other common web image formats, and it pulls the image fresh from the URL each time the sheet loads.

Syntax

=IMAGE(url, [mode], [height], [width])
ParameterDescription
urlThe URL of the image, enclosed in quotes, or a cell reference containing the URL. Must be a publicly accessible image.
modeOptional. Controls how the image fits inside the cell. See modes below.
heightOptional. Custom pixel height (only used with mode 4).
widthOptional. Custom pixel width (only used with mode 4).

Image Modes

ModeBehavior
1 (default)Fit to cell, maintaining aspect ratio. May leave whitespace.
2Stretch to fill cell, ignoring aspect ratio.
3Keep original size. Image may be cropped if the cell is too small.
4Custom size using the height and width parameters.

Basic Examples

Inserting a Simple Image

=IMAGE("https://www.google.com/images/logo.png")

This places the Google logo inside the cell, scaled to fit while preserving proportions.

Building a Product Catalog

ABC (Formula)
1ProductPricePhoto
2Running Shoes$89.99=IMAGE(D2)
3Backpack$45.00=IMAGE(D3)

Column D (hidden) contains the image URLs. Column C displays the actual images. Adjusting the row height to around 100 pixels makes the photos clearly visible.

Country Flags Using Flagcdn

=IMAGE("https://flagcdn.com/w80/us.png")

Replace us with any two-letter country code. This is a quick way to add visual country indicators alongside data in a report.

Advanced Examples

Dynamic Image Based on Cell Value

Suppose column A contains product SKUs and your image hosting follows a consistent naming pattern:

=IMAGE("https://cdn.example.com/products/"&A2&".jpg", 1)

Each row automatically displays the correct product image based on the SKU. No manual image insertion required.

Sparkline-Style Visual Indicators with Icons

You can use IMAGE to display status icons in a dashboard. Combine it with IF to swap between different icons:

=IF(B2>=100,
  IMAGE("https://img.icons8.com/emoji/48/check-mark-emoji.png"),
  IMAGE("https://img.icons8.com/emoji/48/cross-mark-emoji.png")
)

When the metric in B2 hits the target, a green check appears; otherwise, a red X shows. This provides an immediate visual signal without conditional formatting.

Using Mode 4 for Exact Dimensions

=IMAGE("https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=Hello", 4, 200, 200)

This generates a QR code at exactly 200x200 pixels using the Google Charts API. Mode 4 ensures the image renders at the specified dimensions regardless of cell size.

Common Mistakes

  • Using non-public image URLs. The image must be publicly accessible on the web. URLs behind authentication, private Google Drive links, or localhost addresses will not render. For Google Drive images, use the format: https://drive.google.com/uc?id=FILE_ID.
  • Forgetting to resize the row. By default, rows are about 21 pixels tall, which makes most images invisible. Increase the row height (right-click the row number > Resize row) to at least 80-100 pixels to see the image properly.
  • Expecting printed output. Images inserted via the IMAGE function sometimes do not appear when printing or exporting to PDF. If print output is critical, test your export workflow before building the entire sheet around embedded images.

SheetAI Tip

Don't want to memorize this syntax? With SheetAI, just type what you need in plain English and the formula is generated for you. Install SheetAI to try it free.

Skip the formula. Describe what you need.

SheetAI lets you type what you want in plain English and generates the perfect formula — no syntax to memorize.

Try SheetAI Free