The simplest thing I can think of is to open the file you want to save as source code, which you can do from Chrome Android by prepending view-source to the URL, like so.

view-source:https://my-site.tld/xxx/my_page.html

You can then either copy and paste this code into a local file, or use the share button to open it with a compatible app of your choosing.

If this seems like too much of a pain, you might consider doing something like using PHP to determine whether the file should be viewed or downloaded. For example if the IP address of the request matches your phone, download instead of displaying the file.

<?php
/**
 * File url: https://my-site.tld/xxx/my_page.php
 *
 */

$remote_address = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_STRING);

if ($remote_address === '56.57.58.59') {
    header("Content-Disposition: attachment; filename=\"filename.html\"\n");
    header("Content-Type: text/html\n");
}

?>
<!-- Begin actual page content -->
<!DOCTYPE html>
<html lang="en-US">
    <meta charset="UTF-8">
    ....

Conversely, you could also simply create a separate page to allow a download regardless of the requesting IP address.

<?php
/**
 * File url: https://my-site.tld/xxx/my_page-download.php
 *
 */

header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
readfile('path/to/file');

Additional information about the Content-Disposition header may be found in the Mozilla Developer Docs. It's not the only resource, of course, it's just my personal favorite.

Answer from Jose Fernando Lopez Fernandez on Stack Exchange
🌐
Chrome Web Store
chromewebstore.google.com › detail › save-page-we › dhhpefjklgkmgeafimnjhojgjamoafof
Save Page WE - Chrome Web Store
September 5, 2023 - Web Page Downloader allows you to download and save entire web pages, including linked resources, for offline viewing.
Top answer
1 of 2
4

The simplest thing I can think of is to open the file you want to save as source code, which you can do from Chrome Android by prepending view-source to the URL, like so.

view-source:https://my-site.tld/xxx/my_page.html

You can then either copy and paste this code into a local file, or use the share button to open it with a compatible app of your choosing.

If this seems like too much of a pain, you might consider doing something like using PHP to determine whether the file should be viewed or downloaded. For example if the IP address of the request matches your phone, download instead of displaying the file.

<?php
/**
 * File url: https://my-site.tld/xxx/my_page.php
 *
 */

$remote_address = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_STRING);

if ($remote_address === '56.57.58.59') {
    header("Content-Disposition: attachment; filename=\"filename.html\"\n");
    header("Content-Type: text/html\n");
}

?>
<!-- Begin actual page content -->
<!DOCTYPE html>
<html lang="en-US">
    <meta charset="UTF-8">
    ....

Conversely, you could also simply create a separate page to allow a download regardless of the requesting IP address.

<?php
/**
 * File url: https://my-site.tld/xxx/my_page-download.php
 *
 */

header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
readfile('path/to/file');

Additional information about the Content-Disposition header may be found in the Mozilla Developer Docs. It's not the only resource, of course, it's just my personal favorite.

2 of 2
0

You can copy the html raw content (from view-source) into the textarea on this page https://jsfiddle.net/o19q5tzy and press download.

The webpage only contains

<a id="link" href="" download='tmp.html'>download</a><br>
<textarea oninput="link.href = window.URL.createObjectURL(new Blob([this.value], {type: 'plain/text'}))" style="width: 100ch; height: 40ch"></textarea>
Discussions

Creating / downloading a .html file with a chrome extension
I'm building my first Chrome extension. So far my code takes elements of a webpage and creates HTML markup (loaded in a string in Javascript). My extension leads in a button $(".column1").prepen... More on stackoverflow.com
🌐 stackoverflow.com
Chrome recognizes all download links as html files - Google Chrome Community
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on More on support.google.com
🌐 support.google.com
April 10, 2020
Is it possible to download a websites entire code, HTML, CSS and JavaScript files? - Stack Overflow
They'll allow you to scrape a URL ... html/css, etc. Tools like this were invented to view websites while offline, hence the names. However, just keep in mind that these can only download front-end/display facing files, so they can't download back-end scrips, like PHP files, etc. ... In Chrome, go to File -> Save Page ... More on stackoverflow.com
🌐 stackoverflow.com
Download complete web page from Chrome extension
is it possible to programmatically download complete web page (like Chrome can when you hit Ctrl+S) from my web extension? I need the HTML with accompanying resources (images etc), so pageCapture (... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

How can I save a webpage as PDF instead of HTML in Google Chrome?
To save a webpage as a PDF, first, click the three dots in the top-right corner of Chrome to open the menu. Choose 'Print' or press 'Ctrl+P' on your keyboard. In the print settings window that appears, change the destination to 'Save as PDF.' Customize the page settings if needed, like selecting specific pages or adjusting the layout. Click 'Save,' and you'll be prompted to choose a location on your computer to save the PDF file. This process converts the entire webpage into a static document that captures the layout and content as it appears in your browser.
🌐
winbuzzer.com
winbuzzer.com › home › how to download a html page in chrome with images and everything else
How to Download a HTML Page in Chrome with Images and Everything Else
Can I save a webpage in Chrome for offline viewing on mobile devices?
Yes, you can save webpages for offline viewing in Chrome on Android and iOS devices. While browsing in Chrome, tap the three dots to open the menu and look for the download icon or the option to 'Save page for offline viewing.' Chrome will download the webpage, which you can access later from the Downloads section within the browser, even without an internet connection. The process and user interface might slightly vary between Android and iOS.
🌐
winbuzzer.com
winbuzzer.com › home › how to download a html page in chrome with images and everything else
How to Download a HTML Page in Chrome with Images and Everything Else
Can I automate the process of saving webpages for offline viewing in Chrome?
Automating the process of saving webpages for offline viewing isn't a direct feature in Google Chrome. However, users can explore third-party extensions or scripts that automate web browsing actions, including saving webpages. Tools like Puppeteer, a Node library which provides a high-level API to control Chrome over the DevTools Protocol, can be programmed to navigate to webpages and save them automatically. Keep in mind that using third-party tools requires some programming knowledge and an understanding of web technologies.
🌐
winbuzzer.com
winbuzzer.com › home › how to download a html page in chrome with images and everything else
How to Download a HTML Page in Chrome with Images and Everything Else
🌐
daily.dev
daily.dev › home › blog › get into tech › download html page: step-by-step guide
Download HTML Page: Step-by-Step Guide
December 22, 2025 - Right-click anywhere on the page and choose "Save as...". Pick a folder or make a new one to save everything. Type a name for your file and choose "Webpage, Complete (*.htm, *html)" in the "Save as type" dropdown.
🌐
Chrome Web Store
chromewebstore.google.com › detail › singlefile › mpiodijhokgodhhofbcjdecpffjipkle
SingleFile - Chrome Web Store
Save a complete web page (as curently displayed) as a single HTML file that can be opened in any browser.
🌐
Chrome Web Store
chromewebstore.google.com › detail › web-page-downloader › aeojmgngnebhbjpncamiplkimkbnmpmk
Web Page Downloader - Chrome Web Store
January 4, 2026 - Web Page Downloader lets you save complete, pixel-perfect copies of any website for offline viewing—no internet required. Whether a website goes down, changes, or you simply need offline access, this extension ensures you always have a permanent archive at your fingertips. --- Key Features Complete Website Archiving Save everything that makes a webpage work: - HTML Content - The page structure and text - Images - All photos, graphics, and background images - Stylesheets (CSS) - Preserve the exact visual design - Scripts (JavaScript) - Keep interactive elements functional - Documents - Automa
Find elsewhere
🌐
WinBuzzer
winbuzzer.com › home › how to download a html page in chrome with images and everything else
How to Download a HTML Page in Chrome with Images and Everything Else
November 7, 2024 - Webpage, Single File: Save a page in Chrome as a single mhtml file rather than a folder. This reduces clutter but may not have quite as good results for most web pages. Webpage, Complete: Saves a HTML file as well as a separate folder that requires all of the files the website needs to function. Typically has the closest results to the original page. When you’ve decided which is right for you, click it and then press the “Save” button. Verify the Download A dialog will appear at the bottom of your Chrome window with the HTML file.
🌐
Chrome Web Store
chromewebstore.google.com › detail › 下载网页所有资源 › hdeapggikfpgpojodegljabgkemcbflb
DownloadPage(All resources,html+css+js+images) - Chrome Web Store
Download all resources of the web page, including HTML, CSS, JavaScript and images. Download all resources according to the…
Top answer
1 of 1
1

Here's a method I wrote that leverages HTML5's download attribute to download a file:

var saveHTML = function(fileName, html){
    //  Escape HTML

    var el = document.createElement("dummy");
    el.innerText = html;

    var escapedHTML = el.innerHTML;

    //  Use dummy <a /> tag to save

    var link = document.createElement("a");
    link.download = fileName;
    link.href = "data:text/plain,"+escapedHTML;

    link.click(); // trigger click/download
};

saveHTML("myHTML.html", "<html></html>");

Check it out in action here.

If you're not looking to save the file, you can just use storage.

EDIT:

As @Xan pointed out below, the chrome.downloads API exists as well which may be of some use, specifically chrome.downloads.download() method.


As for multiline strings with tabs/spaces/newlines, there's 3 ways:

1.) Manually, using newlines (\n) and tabs (\t)

"<body>\n\t<section>\n\t\t<h1>Here is some HTML text</h1>\n\t</section>\n\t<div>\n\t\t<p>Here's some more</p>\n\t</div>\n</body>"

Which comes out to:

<body>
    <section>
        <h1>Here is some HTML text</h1>
    </section>
    <div>
        <p>Here's some more</p>
    </div>
</body>

2.) Using JavaScript's multi-line string support, which requires that you insert a backslash at the end of a line:

var html = "<body>\
    <section>\
        <h1>Here is some HTML text</h1>\
    </section>\
    <div>\
        <p>Here's some more</p>\
    </div>\
</body>";

3.) Array.join:

var html = [
    "<body>",
    "   <section>",
    "       <h1>Here is some HTML text</h1>",
    "   </section>",
    "   <div>",
    "       <p>Here's some more</p>",
    "   </div>",
    "</body>"
].join("\n");
🌐
PCMAG
pcmag.com › home › how-to › system utilities › browsers
How to Download a Web Page or Article to Read Offline | PCMag
October 9, 2021 - Open the three-dot menu on the top right and select More Tools > Save page as. You can also right-click anywhere on the page and select Save as or use the keyboard shortcut Ctrl + S in Windows or Command + S in macOS.
🌐
GitHub
github.com › TNKSoftware › SingleHtmlDownloader
GitHub - TNKSoftware/SingleHtmlDownloader: Browser extension downloads a current web page as a single file. · GitHub
Browser extension downloads a current web page as a single file. - TNKSoftware/SingleHtmlDownloader
Starred by 16 users
Forked by 9 users
Languages   JavaScript 75.4% | HTML 17.6% | CSS 7.0%
🌐
Chrome Web Store
chromewebstore.google.com › detail › web-page-downloader-downl › cpdhfnobmpfjddfebajaffggbagiggdj
Web Page Downloader - Download any page - Chrome Web Store
Web Page Downloader - Download any page Download any web page and save it as a complete HTML file for offline viewing. Completely free and open source.
🌐
Google Support
support.google.com › chrome › thread › 39288433 › chrome-recognizes-all-download-links-as-html-files
Chrome recognizes all download links as html files - Google Chrome Community
April 10, 2020 - Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on
🌐
MakeUseOf
makeuseof.com › home › internet › how to download a complete webpage for offline reading: 5 methods
How to Download a Complete Webpage for Offline Reading: 5 Methods
September 17, 2024 - You can simplify the process even further with an extension called Save Page WE, which works on Google Chrome as well as Firefox. Once installed, just click on the extension icon from the toolbar to instantly download a web page to a single HTML file (along with all assets included, like images, ads, and formatting).
🌐
CustomGuide
customguide.com › course › google-chrome › save-a-web-page
Save a Web Page - Google Chrome Course
Click the Customize and Control Google Chrome menu button. Select More tools. Select Save page as. Choose a download location. Choose a file name. Click the Save as type menu arrow.
🌐
Google Support
support.google.com › chrome › answer › 7343019
Read pages later & offline - Computer - Google Chrome Help
You can save web pages to read later or when you're offline. To read pages later offline, download them in Chrome ahead of time. Read a page later To read a page later, add it to your readin
🌐
Reddit
reddit.com › r/datahoarder › download a whole web page, including images?
r/DataHoarder on Reddit: Download a whole web page, including images?
August 10, 2020 -

Hi, I've seen a lot of posts here about downloading a whole website.

I only want to download a whole web page, including images. I've tried monolith, but that thing just downloads the html+css and redirects the images to the original source (aka www.site.com). I want to download the images locally too.

What can I use?