In this article:

Google Sheets IMAGE Function (How to Use It in 2024)

May 8, 2024

Google Sheets Image Function

The Google Sheets IMAGE function is used to insert an image into a cell.

The syntax for the IMAGE function is as follows:

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

url: The URL of the image you want to insert into the cell. This URL must be enclosed in quotation marks and must be a link to an image file on the internet.

mode (optional): Specifies how the image is to be displayed in the cell. It is a numerical value with the following options:

  • 1: The image is resized to fit inside the cell, maintaining its aspect ratio. This is the default mode if not specified.

  • 2: The image is stretched or compressed to fit inside the cell, which might change the aspect ratio.

  • 3: The image is inserted in its original size, which might cause the image to overflow from the cell if it's larger than the cell size.

  • 4: Allows specifying a custom size for the image, which requires the use of the height and width parameters.

height (optional): Specifies the height of the image in pixels. This parameter is only used if the mode is set to 4.

width (optional): Specifies the width of the image in pixels. This parameter is only used if the mode is set to 4.

How to Use the Image Function in Google Sheets

Follow the steps below to use the image function in Google Sheets.

1. Copy the URL of the Desired Online Image

Search for the image you want to use online. Right-click on the image and choose "Copy image address" to copy the URL.

google sheets image function

2. Type the IMAGE Function with the Copied URL into the Selected Cell

In the selected cell, type =IMAGE("URL"), but replace "URL" with the actual URL of the image you copied.

image function google sheets

Press Enter to insert the image.

image function in google sheets

3. Change How the Image Fits in the Cell Using Different Modes (Optional)

To change the image's fit, use =IMAGE("URL", mode). Replace "mode" with:

  • 1 to resize the image to fit the cell, maintaining aspect ratio.
  • 2 to stretch or compress the image to fit the cell, changing aspect ratio.
  • 3 to keep the image's original size, which may overflow from the cell.
  • 4 for custom size, requiring height and width parameters.

For our example, we'll replace "mode" with "1" to resize the image to fit the cell.

image function google sheets from drive

After pressing "Enter", the image should fit the cell.

4. Specify Custom Dimensions for the Image (Optional)

For custom dimensions, type =IMAGE("URL", 4, height, width). Replace "height" and "width" with the desired size in pixels.

After configuring the custom dimensions, it should look like this.

5. Review the Inserted Image and Adjust if Necessary

Check the inserted image in your cell. If it doesn't look as expected, adjust the size or cell dimensions. You may need to tweak the function parameters for a better fit.

Using Image Function in Google Sheets From Google Drive

Google Drive doesn't provide a direct URL for images that can be used with the IMAGE function due to its sharing and security framework. The typical shareable link from Google Drive leads to a webpage for the file, not the file itself which prevents direct embedding in Sheets. 

The most reliable way to display an image in Google Sheets is by ensuring the image is accessible via a direct link, which usually means hosting the image outside of Google Drive or using services specifically designed to provide direct image URLs. 

We hope that you now have a better understanding of how to use the Google Sheets IMAGE function. If you enjoyed this article, you might also like our article on Google Sheets time zone conversion or our article on Google Sheets LAMBDA.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->