Spreadsheets are inherently designed for numbers and text, but visual aids are often necessary for product catalogues, real estate listings, or employee directories. While you can manually insert an image over the cells using the standard menu, those images “float” above the grid and do not sort or filter when you organize your data.
Google Sheets solves this with the powerful IMAGE function. This function takes a public URL of a picture and embeds it directly inside the cell itself. The image becomes tied to the data, meaning it will properly sort, filter, and resize alongside your rows.
In this guide, you will learn how to use the IMAGE function and configure its sizing parameters.
The Basic IMAGE Syntax
The simplest way to use the function requires only one argument: a direct link to an image hosted on the internet.
=IMAGE("url")
Crucial Rule: The URL must end in an image file extension, such as .jpg, .png, or .gif. You cannot link to a website (like an Unsplash gallery page); you must link to the raw image file itself. If you right-click an image on a website and select “Copy image address”, that is the link you need.
For example, to display a sample logo:
=IMAGE("https://www.example.com/images/logo.png")
Note: You must enclose the URL in quotation marks.
Advanced Sizing (The Optional Arguments)
By default, Google Sheets will automatically scale the image to fit entirely inside the cell while maintaining its aspect ratio. However, the IMAGE function actually supports four arguments, allowing you to explicitly dictate how the picture behaves.
=IMAGE(url, [mode], [height], [width])
Understanding the “Mode” Argument
The second argument (mode) is a number between 1 and 4 that dictates the sizing logic.
- Mode 1 (Default): Scales the image to fit inside the cell, preserving the aspect ratio. If you resize the row to be taller, the image will grow until it hits the edge.
- Mode 2 (Stretch): Stretches and compresses the image to fill 100% of the cell, completely ignoring the aspect ratio. This will distort the image if the cell dimensions do not match the image dimensions.
- Mode 3 (Original Size): Displays the image at its absolute original resolution, ignoring the cell size. If the image is 1000 pixels wide and your cell is 100 pixels wide, the image will be heavily cropped, and you will only see the top-left corner of it.
- Mode 4 (Custom Size): Allows you to explicitly define the height and width in pixels using the third and fourth arguments.
Using Mode 4 (Custom Size)
If you want to force every employee thumbnail in your directory to be exactly 50×50 pixels, regardless of the cell size, use Mode 4.
=IMAGE("https://www.example.com/images/headshot.jpg", 4, 50, 50)
This tells Google Sheets: fetch the image, use Mode 4, set the height to 50, and the width to 50.
Combining IMAGE with VLOOKUP
The true power of the IMAGE function is unleashed when you combine it with VLOOKUP. If you have a master sheet (e.g., “Product Data”) containing SKUs in Column A and IMAGE URLs in Column B, you can build dynamic dashboards.
On your dashboard, if a user types a SKU into cell A1, you can use:
=IMAGE(VLOOKUP(A1, 'Product Data'!A:B, 2, FALSE))
The VLOOKUP finds the correct URL string, passes it to the IMAGE function, and the picture instantly appears. By mastering the IMAGE function, you can build highly visual, interactive tools that transcend basic data entry.