In this article:

Google Sheets IMAGE Function (How to Use It in 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.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started