Screenshot 2025 08 26 212933

How to Create a Storage Container Barcode System with Google Sheets and QR Codes

Screenshot 2025 08 26 212933

If you’ve ever wished you could scan a storage container barcode (or QR code) and instantly see what’s inside, this guide is for you. With just Google Sheets and Google Apps Script, you can build a simple, low-cost system that makes organizing your garage, attic, or storage unit effortless.
This tutorial will walk you through creating a live inventory where every container gets its own QR code you can scan to reveal what’s inside.

The Real-Life Problem

It’s that time of year again—when the seasons change, decorations come out, and the garage turns into a puzzle of stacked bins.

Your spouse asks: “Can you grab the Thanksgiving container?” You dig through boxes, lifting heavy totes, only to discover you’ve pulled out Easter by mistake.

That used to be my reality.

Now, each container has a unique storage container barcode (QR code) linked to a Google Sheet. One quick scan with my phone, and I know exactly what’s inside—no more guessing, no more heavy lifting.

Why Use QR Codes for Storage Containers?

  • Instant access: Scan a box and instantly view its details.
  • Always up to date: Edit your Google Sheet and every QR code reflects the changes.
  • Low cost: No extra apps or subscriptions required.
  • Customizable: Works for holiday decorations, garage gear, business supplies, or moving boxes.

Step 1: Build Your Storage Inventory Sheet

Create a new Google Sheet with these headers:

ID | Name | Description | Season
Each row represents one container. For example:
  • ID: HG001
  • Name: Christmas Decorations
  • Description: Lights, ornaments, stockings, bows, tree lights
  • Season: Winter / Christmas

Step 2: Add the Apps Script

In Google Sheets, go to Extensions → Apps Script and paste this code.
👉 Replace YOUR_SPREADSHEET_ID_HERE with your own spreadsheet ID.

/**
 * Storage container barcode system powered by Google Sheets
 */
const SHEET_ID = 'YOUR_SPREADSHEET_ID_HERE';
const TAB_NAME = 'Sheet1';
const ID_COL   = 'ID';

function doGet(e) {
  const ss = SpreadsheetApp.openById(SHEET_ID);
  const sh = ss.getSheetByName(TAB_NAME);
  const values = sh.getDataRange().getValues();
  if (values.length < 2) return respond({ error: 'No data' }, e);

  const headers = values[0].map(String);
  const data = values.slice(1);

  const idIdx = headers.findIndex(h => String(h).trim().toLowerCase() === ID_COL.toLowerCase());
  if (idIdx === -1) return respond({ error: `Header '${ID_COL}' not found` }, e);

  let row = null;
  if (e.parameter.id != null) {
    const wanted = String(e.parameter.id).trim();
    row = data.find(r => String(r[idIdx]).trim() === wanted);
  }

  if (!row) return respond({ error: 'Not found' }, e);

  const norm = s => String(s).trim().toLowerCase();
  const record = {};
  headers.forEach((h, i) => (record[norm(h)] = row[i]));

  const fmt = String(e.parameter.format || '').toLowerCase();
  if (fmt === 'card') {
    return HtmlService.createHtmlOutput(`
<meta name="viewport" content="width=device-width, initial-scale=1">
<div style="font-family:sans-serif;max-width:560px;margin:24px auto;padding:20px;border:1px solid #e5e7eb;border-radius:14px;">
  <h2>Storage Container #${record.id}</h2>
  <p><strong>Name:</strong> ${record.name ?? ''}</p>
  <p><strong>Description:</strong> ${record.description ?? ''}</p>
  <p><strong>Season:</strong> ${record.season ?? ''}</p>
</div>
`);
  }

  return ContentService.createTextOutput(JSON.stringify(record))
    .setMimeType(ContentService.MimeType.JSON);
}

function respond(payload) {
  return ContentService.createTextOutput(JSON.stringify(payload))
    .setMimeType(ContentService.MimeType.JSON);
}

Step 3: Deploy as a Web App

  1. In Apps Script, click Deploy → New deployment.
  2. Choose Web app.
  3. Set Execute as: Me and Who has access: Anyone with the link.
  4. Copy your Web App URL.

Your URL will look like:

https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=HG001&format=card

Step 4: Generate QR Codes for Each Container

In your sheet, add this formula (assuming IDs are in column A):

=IMAGE(
  "https://chart.googleapis.com/chart?cht=qr&chs=250x250&chl=" &
  ENCODEURL("https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?id=" & A2 & "&format=card")
)

This generates a QR code for each row. Print and stick them on your containers. Now, when you scan a QR, you’ll see the contents without opening the box.

The Payoff

No more digging through mislabeled bins or playing holiday decoration roulette. With this QR code storage container system, your garage, attic, or storage room becomes fully searchable with just your phone.

It’s flexible, free, and future-proof—you can expand it to hundreds of containers without changing a thing.