Adding images to your spreadsheets can transform a dull list of data into a vibrant catalog, dashboard, or inventory tracker. Google Sheets offers two primary ways to do this: inserting an image over the grid, or inserting it inside a specific cell.

Here is how to use both methods, including the powerful IMAGE function.

Method 1: The "Insert" Menu (Manual Placement)

If you want to place an image so that it floats on top of your spreadsheet (allowing you to move it and resize it freely), this is the method for you.

  1. Click on the cell where you want the image to start.
  2. Go to the top menu and click Insert > Image > Insert image in cell (for a static cell) or Insert image over cells (for a floating image).
  3. A dialogue box will appear. You can choose to upload a file from your computer, take a snapshot, or paste a URL.
  4. Select your image and click Insert.

Note on Local Images: If you are uploading an image directly from your computer's hard drive, it is stored with the Sheet file in Google Drive. For more details on managing these uploads, Google provides a support guide specifically for this process (see support.google.com).


Method 2: The IMAGE Function (Dynamic Placement)

For the best control over how your images fit into a cell, use the =IMAGE formula. This is especially useful if you are working with online image links and want the picture to adjust automatically to the cell size.

The Syntax

The function looks like this:

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

The Mode Options

The "mode" argument tells Google Sheets how to handle the image's size. You can choose from four options:

  • Mode 1 (Resize): Resizes the image to fit inside the cell while maintaining the aspect ratio. (Best for most uses).
  • Mode 2 (Stretch): Stretches or compresses the image to fit inside the cell, ignoring the aspect ratio. (Can cause distortion).
  • Mode 3 (Original): Leaves the image at its original size. If it is larger than the cell, it will be cropped.
  • Mode 4 (Custom): Allows you to specify a specific height and width in the formula.

Example

If you wanted to add an image from a news article to a cell, you would write:

=image("https://i.cbc.ca/1.4972912.1547133821!/fileImage/httpImage/image.jpg_gen/derivatives/16x9_780/new-brunswick-earthquake.jpg")

This will display the image inside the cell using the default "Mode 1" (resize to fit).


⚠️ Important Notes on Image Hosting and Permissions

1. The Image Must Be Publicly Hosted

For the IMAGE() function (and other import functions) to work, the image must be publicly accessible on the internet. If the image is stored in any of the following locations, it will not appear in your sheet:

  • A password-protected website.
  • Your Google Drive with restricted permissions (images hosted at drive.google.com are not supported).
  • A site that blocks "hotlinking" (external sites from linking directly to their images).
  • The image is in SVG file format (SVG is not supported).

Solution: Upload your images to a public image hosting service (like Imgur, or a public Google Photos album) and use the direct image URL (usually ending in .jpg, .png, or .gif).


2. You Must Grant External Access Permissions

When you use the IMAGE() function (or IMPORTHTML, IMPORTXML, IMPORTFEED, IMPORTDATA) for the first time in a spreadsheet, Google Sheets will block the function until you explicitly allow it.

You will see an error message like:

Error: You must allow access to fetch data from external URLs for all IMPORTHTML(), IMPORTXML(), IMPORTFEED(), IMPORTDATA(), IMAGE() functions in this spreadsheet.

How to fix it:

  • Editors of the spreadsheet can click the Allow access button that appears in the warning banner.
  • If you are on a mobile device and don't see the option, paste the spreadsheet URL into the Chrome browser and request the Desktop site version to see the "Allow access" button.

Important behavior to know:

  • This notification only appears once per Sheet.
  • Once an editor clicks "Allow access", the notification is dismissed for all collaborators.
  • All existing IMAGE() functions on the page will be blocked until "Allow access" is clicked.
  • You cannot revoke access after accepting it, unless you use Version history to revert to a previous version of the sheet.

Pro Tip: Using "Google Photos" for Zoom Effects

If you store your images in Google Photos, you can generate different "zoom sizes" by adjusting the URL parameters. This is a clever way to create a dynamic gallery.

For example, if you want to show three different crops or zoom levels of the same image, you can:

  1. Get the shareable link of the image.
  2. Adjust the end of the URL to specify different sizes (e.g., s100, s500).
  3. Place these three different links into three separate columns.
  4. Use the =IMAGE function for each link.

This creates a row where the first column shows a small thumbnail, the second shows a medium crop, and the third shows the full image, allowing you to compare the image at different zooms side-by-side.


Additional Resources