# Image Source Extractor

Extract image URLs (src attributes) from HTML source code. Supports lazy-loaded images and srcset attributes.

> Canonical page: https://elysiatools.com/en/tools/image-source-extractor

- **Category:** Text Processing

- **Keywords:** image, img, extract, html, src, url, parser, dom, website, scraper

## Overview

The Image Source Extractor is a web-based tool that parses HTML source code to extract image URLs from src, data-src, and srcset attributes. It provides a quick way to gather image links for analysis, auditing, or downloading purposes.

## Inputs

- **HTML Source Code** (textarea): Paste your HTML source code here to extract image URLs...
- **Include data-src Attributes** (checkbox): Also extract from data-src attributes (lazy-loaded images)
- **Include srcset Attributes** (checkbox): Also extract from srcset attributes (responsive images)
- **Remove Duplicates** (checkbox): Remove duplicate image URLs from the results
- **Sort By** (select): Choose how to sort the extracted image URLs

## When to use

- When auditing a website's images for SEO checks or performance optimization.
- When scraping web pages to collect image URLs for downloading or cataloging.
- When migrating content and need to extract all image sources from HTML files.

## How it works

- Paste the HTML source code into the input textarea.
- Optionally enable extraction from data-src and srcset attributes using checkboxes.
- Choose to remove duplicate URLs and set the sorting preference.
- The tool outputs a JSON array of the extracted image URLs.

## Use cases

- SEO specialists extracting image URLs to check for alt text and broken links.
- Web developers analyzing image sources for performance improvements or debugging.
- Data analysts collecting image URLs from HTML for machine learning datasets or reports.

## Frequently asked questions

### What image attributes does this tool extract?

It extracts from src attributes by default, and can optionally include data-src for lazy-loaded images and srcset for responsive images.

### Can it handle large HTML files?

Yes, it processes HTML directly in your browser, but very large files may impact performance.

### How are duplicate URLs handled?

Duplicates are removed by default, but you can disable this to preserve all occurrences.

### Is the output sorted?

You can choose to sort URLs alphabetically or preserve the original order from the HTML.

### What format is the output in?

The output is a JSON array containing the extracted image URLs as strings.

## Related tools

- [HTML Tag Stripper (HTML标签清除)](https://elysiatools.com/en/tools/new-html-tag-stripper): Remove HTML tags from code and extract clean text content
- [Bulk Email Extractor](https://elysiatools.com/en/tools/bulk-email-extractor): Extract all email addresses from input text, articles, web source code, or mixed content. Supports deduplication and export to JSON.
- [HTML to Markdown Converter](https://elysiatools.com/en/tools/html-to-markdown): Convert HTML content to Markdown format with customizable options using Turndown
- [HTML Table to CSV](https://elysiatools.com/en/tools/html-table-to-csv): Extract and convert HTML table data to CSV format
- [Bulk URL/Link Extractor](https://elysiatools.com/en/tools/bulk-url-extractor): Extract all HTTP/HTTPS links from text with deduplication and export options
- [Chinese Character Extractor (汉字提取器)](https://elysiatools.com/en/tools/chinese-character-extractor): Extract all Chinese characters from text, filtering out punctuation and English letters, numbers, and non-Chinese symbols
- [Hashtag & Mention Extractor](https://elysiatools.com/en/tools/hashtag-mention-extractor): Extract hashtags (#Topic) and user mentions (@Username) from social media text like Twitter, Instagram, etc.
- [IP Address Extractor](https://elysiatools.com/en/tools/ip-address-extractor): Extract IPv4 and IPv6 addresses from log files, server logs, network traces, or any text content

## Samples

- [Docker Image Tag Samples](https://elysiatools.com/en/samples/docker-image-tag): Collection of Docker image references with various registries, repositories, tags, and digests
- [HTML with Images Samples](https://elysiatools.com/en/samples/html-with-images): HTML source code samples with images for testing extraction
- [Changelog Extractor Samples](https://elysiatools.com/en/samples/changelog-extractor): Various changelog formats for testing changelog parsing and extraction tools
- [Phone Number Extractor Samples](https://elysiatools.com/en/samples/phone-number-extractor): Collection of mixed text containing phone numbers from various countries for extraction testing

## Related content

- [HTML Content Extraction, Cleanup, and Delivery](https://elysiatools.com/en/hubs/html-content-extraction-cleanup-and-delivery): Extract links, images, attributes, and tables from HTML, remove unwanted markup, and ship verified Markdown, PDF, or CSV outputs.
- [Web Source Reuse and Publication Audit](https://elysiatools.com/en/hubs/web-source-link-and-metadata-audits): Extract source evidence, inspect links and assets, analyze metadata and query strings, and check RSS/Atom and robots.txt before reuse, migration, or release.
- [HTML Email Review and PDF Delivery](https://elysiatools.com/en/hubs/html-convert): Inspect HTML email metadata, review fragile attributes and image references, create a reviewer-safe fallback copy, and render a shareable PDF proof.
- [Structured Signal Extraction from Text, HTML, Markdown, and Logs](https://elysiatools.com/en/hubs/text-extract): Turn mixed text sources into reviewable links, attributes, dates, log fields, and sensitive-match inventories with a deliberate extraction path.
