惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
腾讯CDC
D
Docker
The Cloudflare Blog
量子位
爱范儿
爱范儿
L
LangChain Blog
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
Vercel News
Vercel News
MyScale Blog
MyScale Blog

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Learn Command Line Interface (CLI) Development with Dart: From Zero to a Fully Published Developer Tool How to Build a Live Options Database in Python – A Complete Guide How to Migrate to S3 Native State Locking in Terraform How to Use SCons to Build Software Projects [Full Handbook] How to Run Open Source LLMs Locally and in the Cloud QuRT: The Real-Time OS Inside Your Phone's Processor [Full Handbook] The Real Infrastructure Behind Remote Work (It’s Not Just Wi-Fi) The Lithography Handbook: Machines, Markets, and the Next Wave of Semiconductor Startups ITCM vs DTCM vs DDR: Embedded Memory Types Explained [Full Handbook] AI Paper Review: Improving Language Understanding by Generative Pre-Training (GPT-1) How to Build a Market Research Copilot with MCP and Python [Full Handbook] How to Build a Scoped Note-Taking API with Django Rest Framework and SimpleJWT The Complete SOC 2 Type II Implementation Handbook for Engineers: A Month-by-Month Roadmap with Real Commands Mastering the JavaScript Event Loop Data Science Insights: Why the Mean Lies When Handling Messy Retail Data How to Build High-Ranking SEO Landing Page How to Query Data in DynamoDB Using .Net How to Unblock Your AI PR Review Bottleneck: A Tech Lead’s Guide to Building a Codebase-Aware Reviewer How to Navigate Microservices as a Frontend Engineer How to Compress PDF Files in the Browser Using JavaScript (Step-by-Step) Stanford's youngest instructor talks InfoSec, AI, and catching cheaters - Rachel Fernandez interview [Podcast #217] Product Experimentation with Propensity Scores: Causal Inference for LLM-Based Features in Python How to Build a Multi-Agent AI System with LangGraph, MCP, and A2A [Full Book] How to Land Your First Cloud or DevOps Role: What Hiring Managers Actually Look For How to Deploy a Serverless Spam Classifier Using Scikit-Learn, AWS Lambda, & API Gateway How to Dockerize a Go Application – Full Step-by-Step Walkthrough Learn Hardware, Cloud, DevOps, Networking, Security, Databases, DNS, Git, and Linux Inside TreeHacks 2026, Stanford’s Elite Student Hakc Inside Stanford’s Elite Student Hackathon [Full Documentary] How to Measure Your AI Citation Rate Across ChatGPT, Perplexity, and Claude
How to Insert Images in Google Sheets
Vikram Aruchamy · 2026-06-25 · via freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
How to Insert Images in Google Sheets

Google Sheets is widely used for tracking data, managing inventories, building product catalogs, and creating dashboards. In many of these use cases, adding images directly into a spreadsheet makes the data easier to understand and work with.

Whether you're displaying product photos, marketing assets, or property listings, Google Sheets provides several ways to insert and display images.

In this tutorial, you'll learn how to:

  • Insert images using the Insert menu in Google Sheets

  • Display images from a URL using the IMAGE() function

  • Work with multiple images stored in Google Drive

Table of Contents

  • Understanding How Images Work in Google Sheets

  • Inserting Images Using the Insert Menu in Google Sheets

  • Inserting Images in Google Sheets Using the IMAGE Function

  • Inserting Multiple Images from URLs

  • Best Practices

  • Working with Multiple Images Stored in Google Drive

  • Which Method Should You Choose?

  • Conclusion

Understanding How Images Work in Google Sheets

The way an image is inserted in Google Sheets determines how it behaves when you sort data, resize rows, or build automated workflows.

This becomes particularly important when working with product catalogs, asset trackers, or spreadsheets that are connected to Google Drive workflows, such as listing files from Drive into Google Sheets or uploading files from Google Sheets into Google Drive.

Before inserting images, it's important to understand the two image placement options available in Google Sheets:

Images Inside Cells:

Images become part of the cell itself and behave like spreadsheet data when rows and columns are moved, resized, filtered, or sorted.

The following image shows how the image inserted inside Google Sheets cell looks like:

Image inside a cell in Google Sheets

Benefits of inserting an image inside a cell include:

  • Moves with rows and columns

  • Resizes when cells are resized

  • Sorts correctly with spreadsheet data

  • Ideal for inventories and catalogs

Images Over Cells:

Images remain independent of the underlying cells and float above the spreadsheet, allowing them to be freely positioned and resized without affecting spreadsheet data.

The following image shows how the image inserted over the Google Sheets cell looks:

Image over the cell in Google Sheets

Benefits include:

  • Freely position images anywhere on the sheet

  • Useful for logos and visual elements

  • Better suited for dashboards and reports

For most spreadsheet-based workflows, Images inside Cells is usually the preferred option.

If you're working with a large number of images stored in Google Drive, manually collecting image URLs can quickly become time-consuming.

Tools such as Drive Explorer Pro can help automate this process by listing files and generating image URLs directly in Google Sheets. It can also include additional file metadata such as image previews, file names, download URLs, sharing permissions, and other file details, making it easier to organize, manage files at scale as shown in the following image:

Listing google drive file in Google Sheets

Next, you'll see how to insert images inside cell or over a cell.

The Insert menu is the simplest way to add a small number of images to Google Sheets. Using this method, you can insert images either inside cells, where they behave like spreadsheet data, or over cells, where they float above the worksheet.

Image in Cell

  1. Select the destination cell.

  2. Click Insert → Image → Insert an image in the cell.

  3. Choose an image source:

    • Upload from computer

    • Google Drive

    • Google Photos

    • Camera

    • URL

  4. Select the image and click Insert.

Google Sheets places the image inside the selected cell, allowing it to move, resize, and sort with your spreadsheet data.

Tip: Resize rows and columns before inserting images. Large image files can increase spreadsheet size even when displayed in small cells.

Best for:

  • Product catalogs

  • Inventory tracking

  • Asset management

  • Small datasets with manual image entry

Limitation: Each image must be inserted individually, making this approach difficult to maintain for larger datasets.

Image Over Cells

  1. Click Insert → Image → Insert an image over the cells.

  2. Select and upload an image.

  3. Resize and position it as needed.

Unlike images in cells, these images float above the spreadsheet and aren't tied to specific rows or columns.

Best for:

  • Company logos

  • Dashboard graphics

  • Visual annotations

  • Presentation-style spreadsheets

For inventories and product databases, Image in Cell is usually the better choice.

If you need larger image previews, see how to create an image lightbox in Google Sheets using XLOOKUP or Apps Script.

Inserting Images in Google Sheets Using the IMAGE Function

If your images are already available online, the IMAGE function can display them directly inside spreadsheet cells using a URL.

TheIMAGE() function doesn't store images inside the spreadsheet. It simply displays images from external URLs. If the source image is deleted, moved, or becomes inaccessible, the image will disappear from the sheet.

IMAGE Function Syntax

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

The optional mode parameter controls how the image is displayed inside the cell.

Google Sheets supports four display modes:

Mode Formula Behavior
1 (Default) =IMAGE(A2,1) Fits the image inside the cell while preserving its aspect ratio
2 =IMAGE(A2,2) Stretches the image to fill the entire cell
3 =IMAGE(A2,3) Displays the image at its original dimensions
4 =IMAGE(A2,4,200,200) Displays the image using custom width and height values

For most spreadsheets, Mode 1 is the best choice because it maintains image proportions while fitting neatly within the cell. Use Mode 4 only when you need fixed image dimensions, as custom-sized images can become more difficult to maintain in large spreadsheets.

Basic Example

=IMAGE("https://example.com/product-image.jpg")

Google Sheets retrieves the image from the URL and displays it inside the cell using Mode 1 by default.

Displaying Images from a Column of URLs

If column B contains image URLs, use:

=IMAGE(B2)

Then copy the formula down to generate image previews for every row.

Best for:

  • Product catalogs

  • eCommerce inventory sheets

  • Asset tracking systems

  • Marketing content databases

Common Issues

Most IMAGE function problems are caused by one of three issues:

Permissions: Google Drive images must be shared as Anyone with the link can view.

Direct URLs: Standard Google Drive sharing links won't work. Convert them to:

https://drive.google.com/uc?id=FILE_ID

Performance: Because the IMAGE function loads images from external URLs whenever the spreadsheet recalculates, large image files or hundreds of image formulas can impact spreadsheet performance. For best results, use optimized image sizes rather than full-resolution photos.

Inserting Multiple Images from URLs

When image URLs are already stored in a spreadsheet, the IMAGE function can generate image previews automatically for every row using the ARRAYFORMULA() function.

For example, if image URLs are stored in column A:

=ARRAYFORMULA(IF(A2:A="","",IMAGE(A2:A)))

This formula applies the IMAGE function to every populated row, eliminating the need to insert images individually.

Benefits:

  • No manual image insertion

  • Automatically updates when image URLs change

  • Easy to maintain as data grows

  • Works well with imported or generated datasets

  • Can be combined with automated workflows

This approach is commonly used for:

  • Product catalogs

  • Inventory management

  • Asset tracking systems

  • Marketing content databases

For most spreadsheet-based image workflows, this is the simplest and most scalable way to display multiple images in Google Sheets.

Performance Considerations:

Displaying a large number of images can impact spreadsheet responsiveness because each image must be retrieved and rendered from its source URL.

To maintain performance:

  • Use optimized image sizes instead of full-resolution photos

  • Avoid displaying thousands of images on a single sheet

  • Apply filters when working with large datasets

  • Split large image catalogs across multiple sheets when necessary

Troubleshooting:

Problem Likely Cause Fix
Broken image or empty cell Source not public Set Drive file to Anyone with the link, then test URL in an incognito window
Formula runs but no image Unsupported format IMAGE supports PNG, JPEG, and GIF only
Works in browser, not in sheet Viewer page URL, not direct link Use uc?id=FILE_ID or lh3.googleusercontent.com/d/FILE_ID
Image never loads Password-protected or login-required site Move image to a publicly accessible host
Sheet loads slowly Large source files Resize to ~200×200 px before linking

Best Practices

  • Optimize before linking: Resize images to thumbnail dimensions (~200×200 px) instead of linking 5 MB originals.

  • Use predictable URL patterns: If images follow a folder structure, generate URLs with CONCATENATE rather than maintaining a static URL per row: =IMAGE("https://cdn.example.com/products/" & A2 & ".jpg")

  • Don't expose sensitive files: Making a Drive file public just to display it in a sheet can expose it to anyone who sees the URL. For private images, use the Insert menu or a tool that respects Drive permissions.

Working with Multiple Images Stored in Google Drive

When images are stored in Google Drive, displaying them with the IMAGE function requires an image URL for each file. While this is manageable for a few images, manually collecting URLs can quickly become time-consuming when working with larger image libraries.

A common workflow is to first list files from Google Drive into Google Sheets, then use the resulting file links or image URLs to generate image previews with the IMAGE function.

This approach works particularly well for:

  • Product catalogs

  • Inventory tracking

  • Marketing asset libraries

  • Team directories

For a small number of files, you can paste Google Drive sharing links into a spreadsheet and convert them into image previews using a formula:

=IMAGE("https://drive.google.com/uc?export=view&id=" & REGEXEXTRACT(A2,"/d/([^/]+)"))

Each file must be shared as Anyone with the link can view for the image to display correctly.

Working with Large Image Libraries:

When managing hundreds or thousands of images, manually collecting and converting Drive links becomes difficult to maintain.

In these situations, it's often more efficient to first list files from Google Drive into Google Sheets and then generate image previews automatically.

Video Tutorial: How to Insert Image Inside a Cell in Google Sheets

Which Method Should You Choose?

Use Case Recommended Method
Insert a few images manually Insert Menu
Add logos and graphics Image Over Cells
Display images from URLs IMAGE Function
Product catalogs IMAGE Function
Inventory management IMAGE Function
Large Google Drive image libraries Drive Explorer Pro + IMAGE Function

Conclusion

While inserting a few images into Google Sheets is straightforward, managing images at scale requires a different approach. Understanding the difference between manually inserted images, URL-based images, and Google Drive workflows allows you to build spreadsheets that remain efficient as your data grows.

By using the right image workflow from the start, you can create catalogs, inventories, and reporting systems that are easier to update, automate, and maintain over time.



Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started