Skip to content
Google Sheets

IMAGE function in Google Sheets

Inserts an image into a cell.

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

IMAGE syntax and parameters

Four arguments, one required.

  • urlstringRequired

    The URL of the image, including protocol (e.g. http://). The value for url must either be enclosed in quotation marks or be a reference to a cell containing the appropriate text.

  • modenumberOptional

    [ OPTIONAL - 1 by default ] - The sizing mode for the image 1 resizes the image to fit inside the cell, maintaining aspect ratio. 2 stretches or compresses the image to fit inside the cell, ignoring aspect ratio. 3 leaves the image at original size, which may cause cropping. 4 allows the specification of a custom size. Note that no mode causes the cell to be resized to fit the image.

  • heightnumberOptional

    [ OPTIONAL ] - The height of the image in pixels. mode must be set to 4 in order to set a custom height.

  • widthnumberOptional

    [ OPTIONAL ] - The width of the image in pixels. mode must be set to 4 in order to set a custom width.

IMAGE examples

Formulas you'll actually reuse.

  1. A product logo per row from a URL built off the SKU, fit to the cell:

    =IMAGE("https://example.com/logos/" & A2 & ".png")
  2. A fixed 120×200 px render — mode 4 unlocks custom height and width:

    =IMAGE("https://example.com/chart.png", 4, 120, 200)

IMAGE in Excel

Same name — your formula ports as-is.

Try IMAGE in the playground

Edit the example — nothing to install.

Preloaded with the IMAGE formula from Example 1 — change anything and watch it respond.

Loading the editor…

IMAGE errors

What they mean — and the fixes.

  • #VALUE!

    The URL isn't publicly reachable or isn't an image — Sheets can't fetch images that sit behind a login.