Guides

How to Extract All Image URLs & Alt Text from HTML Source Code Online

To extract every image URL and `alt` text attribute from an HTML webpage or email template—including standard <img src> tags, responsive srcset candidates, lazy-loaded data-src attributes, and <picture> sources—parse the HTML Document Object Model (DOM) directly in your browser using the EasyExtract HTML Image Extractor. It resolves relative paths against your base URL and exports a clean CSV or URL list 100% locally in browser RAM with zero server uploads.

Whether you are running a technical SEO audit to find images with missing `alt` attributes, migrating product photography from a legacy e-commerce storefront, or inspecting image assets inside an HTML newsletter, manually hunting through `view-source` is slow and error-prone. Modern frontend frameworks (Next.js, Shopify, WordPress) rarely put a single URL inside ``—instead, they spread image URLs across `srcset`, ``, `data-lazy-src`, and OpenGraph `` tags.

This guide explains where modern webpages store image URLs in HTML markup and how to extract every image URL and `alt` attribute in seconds.

5 Places Where Modern HTML Pages Hide Image URLs

If you only search an HTML file for ``, you will miss or capture placeholder `1×1.gif` data URIs on many modern websites. Here are the five DOM locations where image URLs actually live:

  1. Standard Image Tags (`...`): The classic W3C image element pairing a source URL with screen-reader `alt` text.
  2. Responsive `srcset` Lists (``): Stores comma-separated resolution or pixel-density (`1x`, `2x`, `3x`) image URLs so browsers can pick the sharpest asset.
  3. Art-Direction `` & `` Elements: Wraps multiple `` and `` tags around a fallback ``.
  4. Lazy-Loading Data Attributes (`data-src`, `data-lazy-src`, `data-original`): JavaScript lazy-loaders often place a tiny Base64 placeholder in `src=”data:image/gif;base64…”` and store the real high-resolution photo URL inside `data-src`.
  5. OpenGraph & Twitter Card Meta Tags (``): Defines the high-resolution featured social preview image in the ``.

Method 1: Extract Image URLs & Alt Text in Your Browser (Zero Uploads)

Using an inert browser `DOMParser` guarantees that scripts inside the pasted HTML never execute while every image node is accurately cataloged:

  1. Open the free HTML Image Extractor on EasyExtract.
  2. Paste your raw HTML source code (from `Ctrl+U` / *View Page Source* or DevTools *Copy outerHTML*) into the input box.
  3. Resolve Relative Paths (Optional): If the HTML contains root-relative paths like `/assets/hero.webp`, enter the page’s base domain (`https://example.com`) so the tool outputs complete, clickable URLs.
  4. Review URLs & Alt Attributes: Inspect the extracted list of image URLs and their corresponding `alt` text, then copy the URLs or download a structured CSV spreadsheet for your SEO or migration audit.
HTML / Media Extraction Goal Recommended EasyExtract Tool Output
Extract `` URLs & `alt` text from HTML source HTML Image Extractor List of absolute/relative image URLs + `alt` text CSV.
Extract inline `` vector icons from HTML HTML Inline SVG Extractor Standalone `.svg` vector files & paths.
Decode `data:image/png;base64,…` strings to files Base64 Image Extractor Downloadable PNG, JPG, WebP, or SVG files.
Extract `` hyperlinks from HTML source HTML Link Extractor All hyperlink URLs + anchor text.

Method 2: Extract All Image URLs via Chrome DevTools Console One-Liner

If you are inspecting a live Single-Page Application (SPA) in Chrome, Edge, or Brave and want to dump every currently rendered image URL (`currentSrc` resolves whichever `srcset` image the browser selected) plus its `alt` text:

console.table(Array.from(document.images, img => ({
  src: img.currentSrc || img.src || img.dataset.src,
  alt: img.alt || '(MISSING ALT)',
  width: img.naturalWidth,
  height: img.naturalHeight
})));

Frequently Asked Questions

Why do some extracted image URLs start with `data:image/svg+xml;base64,`?

Those are **Base64 Data URIs**—small images or lazy-load placeholders embedded directly inside the HTML text rather than hosted at an external `.png` or `.jpg` URL. If you want to decode those Base64 strings into downloadable image files, paste the HTML into our Base64 Image Extractor.

How do I extract inline `` icons that don’t use `` tags?

Many modern websites embed vector icons directly in the DOM using `…` tags instead of ``. Use our SVG Extractor to pull every inline `` element out of HTML and download them as `.svg` files.

Is my HTML source code uploaded to a server?

No. The HTML Image Extractor parses your markup strictly in local browser memory using `DOMParser`. Nothing is ever uploaded.

Shah Abrar Ahmad - Founder & Lead Engineer
Lead Architect & Founder

Software architect and technical web engineer specializing in browser-based zero-knowledge file parsing, technical SEO, and data extraction security. Built EasyExtract to give users 100% private in-browser tools with zero cloud uploads.

Keep reading