Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For an editable, deployable blank webpage, save a minimal document as index.html. For the browser’s built-in empty document, use about:blank. An iframe can use src="about:blank" or inline srcdoc, and JavaScript can request a blank browsing context with window.open('').

Make an editable blank HTML page

Create a plain-text file named index.html and save this document:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Blank page</title>
  </head>
  <body></body>
</html>

Double-click the file to open it locally, or place it in the document root of your web server and visit its address. The page is visually empty because the body has no content, but it is still a complete HTML document that you control and can edit.

What each part does

  • <!doctype html> asks the browser to use the modern HTML parsing mode.
  • <html lang="en"> identifies the document language for accessibility tools and other software. Change en to the page’s actual language.
  • <meta charset="utf-8"> sets the text encoding.
  • <meta name="viewport" content="width=device-width"> gives the page a useful viewport on phones and tablets.
  • <title> supplies a browser-tab title even though the page itself has no visible content.
  • An empty <body> is the part that makes the rendered page blank. Add elements there later without changing the document’s basic structure.

Save it without accidentally creating a text file

  1. Open a text or code editor, not a word processor.
  2. Paste the document and choose Save As.
  3. Use the exact filename index.html. If your editor has a file-type option, choose plain text or HTML.
  4. Open the saved file in a browser. The address will normally begin with file:// when opened locally.

If the browser displays the markup as text, the editor probably saved index.html with an extra extension such as .txt. Show file extensions in your operating system and rename the file to exactly index.html.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Use about:blank for the browser’s empty document

about:blank is a browser URL, not an HTML file that you upload. Enter it in the address bar to navigate the current tab, or use it as the destination of a link:

<a href="about:blank">Open a blank document</a>

The result can look identical to an empty index.html, but the ownership is different. With index.html, you own the source and can deploy it. With about:blank, the browser creates the empty document from the special about URL.

Open a blank page with JavaScript

Pass an empty string, omit the URL argument, or explicitly use about:blank:

// Requests a new blank browsing context
const first = window.open('', '_blank');

// Equivalent URL behavior
const second = window.open();

// Explicit browser blank document
const third = window.open('about:blank', '_blank');

The returned value is a Window object when the browser permits the request. If the browser blocks the popup, the result is null. Popup policies are commonly tied to whether the call happened directly inside a user action such as a click, so handle failure instead of assuming a new tab exists:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
document.querySelector('#open-blank').addEventListener('click', () => {
  const tab = window.open('', '_blank');
  if (!tab) {
    document.querySelector('#status').textContent =
      'The browser blocked the new window. Allow popups or use the link instead.';
    return;
  }
  tab.focus();
});

This code expects an element with id="open-blank" and an element with id="status". A normal <a href="about:blank" target="_blank"> link is a useful fallback because it still works when script execution or popup permission is unavailable.

Embed a blank page in an iframe

Use src="about:blank"

<iframe
  src="about:blank"
  title="Empty embedded document"
  width="800"
  height="450">
</iframe>

This embeds an empty document and conforms to the same-origin policy. An empty frame has no visible content, so give it dimensions if you need to see its box while developing. The blank document uses the embedding document’s URL as its base URL for relative URLs.

Use srcdoc for inline markup

<iframe
  title="Inline blank document"
  srcdoc="<!doctype html><html lang='en'><head><meta charset='utf-8'><title>Inline page</title></head><body></body></html>"
  width="800"
  height="450">
</iframe>

srcdoc is useful when the initial document must be written directly in the parent HTML. Its document location is about:srcdoc, which is different from about:blank. If both attributes are present, srcdoc supplies the document and takes precedence over src. For substantial inline markup, escaping quotes and angle brackets becomes difficult; a separate index.html is usually easier to maintain.

Choose the technique that matches the job

Need Use Who owns the markup? Document URL or context
Start a local or hosted website file index.html You control and deploy the source The file’s URL, such as file:// locally or your site URL
Navigate a tab to an empty browser document about:blank The browser creates it about:blank
Embed an empty document <iframe src="about:blank"> The browser creates the frame document Blank document with the embedding page as its base for relative URLs
Embed initial HTML without another request <iframe srcdoc="..."> The parent document supplies the markup about:srcdoc
Request a blank tab or window from code window.open('') or window.open() The browser creates the requested context An empty URL opens a blank page in the targeted context

Keep a blank page useful for later work

Do not remove the head just because the body is empty. A title, language declaration, character encoding, and viewport setting make the file a sound starting point for future content. When you add visible content, put it in body; put styles in a stylesheet or a <style> block, and behavior in a script or external JavaScript file. Keeping those responsibilities separate makes it clear whether a later problem comes from the HTML structure, presentation, or behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a temporary test fixture, an empty body is often preferable to whitespace, placeholder text, or a transparent image: test code can tell that the document loaded while the rendered output remains empty. If a human must understand the page in a tab or screen reader, retain a meaningful title even when there is nothing to display.

Or skip the browser setup

If your goal is to capture a hosted blank page rather than build the HTML by hand, ScreenshotNeo is the first service to try: it removes cookie banners, popups, and chat widgets before capture, bills only clean shots, and has the lowest paid starting plan.

Deploy your index.html at a reachable URL, then call the API. Replace https://example.com with that URL. The parameter names used by other screenshot APIs also work.

See the complete request options in the ScreenshotNeo API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Capture a full page, including lazy-loaded images, or one element selected by CSS.
  • Set a viewport or one of 12 device presets, choose retina scale, and request PNG, JPEG, WebP, or PDF output.
  • Wait for a selector, a delay, or network idle; run custom JavaScript or CSS; click an element; hide selectors; and block ads, trackers, requests, or resource types.
  • Supply headers, cookies, a user agent, an Authorization value, timezone, or geolocation when the hosted page needs them.
  • Use transparent backgrounds, resizing, a cache TTL, signed links, asynchronous jobs with signed webhooks, bulk capture for up to 100 URLs per call, usage reporting, and the OpenAPI specification.
  • The response identifies the outcome with X-Page-Verdict and X-Billed headers. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing.
  • An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan, and yearly billing provides two months free. Create a free ScreenshotNeo account to begin.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting blank pages

The browser shows the HTML tags instead of a blank page

That means the file is being treated as text. Confirm that the filename ends in .html, that the editor did not append .txt, and that you opened the saved file rather than a copy of the source pasted into a text viewer.

The iframe appears to be missing

An empty document has no content to draw. Set explicit width and height attributes or equivalent CSS on the iframe so its empty rectangle is visible. Also check that the iframe element itself was not hidden by surrounding CSS.

srcdoc does not behave like a normal page URL

That is expected: its location is about:srcdoc. Keep the inline document small, escape quotation marks correctly, and move the source into a separate index.html when it becomes difficult to read or maintain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

window.open() returns null

The browser refused the new browsing context, commonly because the call was not associated with a permitted user action or popups are disabled. Test the call from a click handler and provide a normal link to about:blank as a fallback.

The page is blank when you expected content

Inspect the saved file and confirm that the elements you intended to add are inside body. For an iframe, verify whether you selected src or srcdoc; when both are present, the inline srcdoc document is the one displayed.

FAQ

Should an empty HTML file be committed to version control?

Yes, if it is an intentional starting point, test fixture, or route. Commit the editable index.html (and any srcdoc source kept in a parent file); do not treat about:blank as source code.

Can I replace a blank implementation later without changing its container?

Yes. An iframe can begin with src="about:blank" or srcdoc and later point to a real URL or richer inline document. A standalone index.html can likewise gain content while keeping its document shell.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Should an empty HTML file be committed to version control?

Yes, when it is an intentional starting point, test fixture, or route. Commit the editable index.html and any maintained srcdoc source; about:blank is browser state, not source code.

Can I replace a blank implementation later without changing its container?

Yes. An iframe can start with about:blank or srcdoc and later use a real URL or richer inline document. A standalone index.html can gain content without changing its basic document shell.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.