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

View Page Source shows the initial HTML or XML document returned for a page request. It is a read-only snapshot of what the server sent, before the browser’s JavaScript changes the document. Use it to audit server-rendered markup and resource references; use DevTools’ Elements or Inspector panel when you need the live DOM, styles, scripts, network requests, or runtime behavior.

What View Page Source actually shows

When you choose View Page Source, the browser opens the HTML or XML source associated with the current request, usually in a new tab. The text may include the document type, html, head and body elements, headings, links, metadata, inline styles, script tags and server-rendered content.

This is the initial response, not a recording of everything that later happens in the browser. A page can download data, run JavaScript, insert components, remove nodes or alter attributes after the response arrives. Those changes are visible in the live DOM, not necessarily in source view.

Opening source in common browsers

  • Firefox: right-click the page and choose View Page Source, or press Ctrl+U on Windows/Linux or Cmd+U on macOS.
  • Chrome, Edge and other Chromium browsers: right-click and choose the source-view command, or use the browser’s View Source command with Ctrl+U (Windows/Linux) or Cmd+Option+U where supported.
  • Developer tools: open with Ctrl+Shift+I or F12 on Windows, and Cmd+Option+I on macOS. In Firefox, inspect the Inspector; in Chrome, Edge and Safari, use the Elements (or equivalent) panel.

Source versus the live DOM

The most important distinction is timing. Source is the literal document associated with the initial response. The DOM is the browser’s parsed, current tree. DevTools displays that current tree and lets you edit it temporarily.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Comparison View Page Source Elements/Inspector
Stage Initial server response Current document at inspection time
Mutability Read-only view Live, temporarily editable DOM
JavaScript changes Normally absent Included after scripts run
Parsing Literal source text Browser-normalized tree
Scope Markup and referenced resources Markup, styles, properties and runtime inspection

Malformed HTML can make the two views differ even before application code runs. Browsers repair misnested tags, create implied elements and normalize the input while parsing. Therefore, a mismatch is not automatically evidence that JavaScript changed the page.

How developers use source view

Audit server-delivered markup

Search source for the initial <title>, description and other metadata, canonical links, structured-data blocks, preload and stylesheet links, script tags, language attributes and server-rendered text. This is useful for checking what crawlers or a non-JavaScript client receive first.

Source view also reveals whether a reference is inline or external and whether its URL is relative, absolute or malformed. It does not prove that every referenced file loaded successfully; use the Network panel for that.

Find why visible text is missing

If a phrase appears on screen but cannot be found with Find in Page Source, the application may have inserted it after load. Common causes include a client-side framework rendering a component, an API response populating a list, or a script replacing placeholder text. Compare the source with Elements, then inspect the Network panel to identify the request that supplied the data.

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

Check parser behavior

When a layout behaves unexpectedly, inspect both the literal source and the parsed DOM. Unclosed paragraphs, incorrectly nested tables and duplicate or misplaced elements can be repaired into a structure different from the author’s text. The Elements tree shows the structure the browser actually uses.

Move from markup to runtime diagnostics

Use the appropriate DevTools panel instead of forcing source view to answer a runtime question:

  • Elements/Inspector: current DOM, attributes and applied style rules.
  • Computed styles: final values after inheritance and the cascade.
  • Console: JavaScript errors, warnings and experiments.
  • Network: requests, responses, status codes, timing, headers and later data.
  • Sources/Debugger: loaded files, breakpoints and execution context.

For failed CSS imports, invalid URLs and script debugging, the Sources and Console tools provide evidence that source view alone cannot.

What source view cannot show by itself

  • DOM nodes created, removed or changed after the initial response.
  • Computed CSS, layout measurements, pseudo-elements and the final visual style.
  • Event-handler effects, application state and framework component state.
  • API responses and other network activity that populated the page later.
  • Whether a script, image, stylesheet or font actually loaded successfully.
  • Content hidden by runtime conditions, personalization, authentication or geolocation after the request.

A missing string in source therefore does not prove that the page never displays it. Conversely, text present in source may be hidden, replaced or removed before a visitor sees it.

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

A practical source-to-runtime workflow

  1. Open source. Use the context-menu command or the keyboard shortcut and note the page URL and response context.
  2. Search for the symptom. Look for the visible phrase, element ID, class, title, canonical URL, JSON-LD block or script name.
  3. Record what is present. Distinguish server-rendered text and attributes from references that merely request another file.
  4. Inspect the live DOM. Open Elements/Inspector and search for the same node. If it exists there but not in source, a parser or script changed the tree.
  5. Check the Console. Fix syntax errors, exceptions and blocked-resource warnings before drawing conclusions about rendering.
  6. Check Network. Reload with DevTools open, inspect document and API responses, and verify status codes and timing.
  7. Use Sources/Debugger. Set a breakpoint around code that creates or modifies the missing node.
  8. Test a clean reload. Compare logged-out and logged-in states, different viewport conditions and a reload with cache disabled when appropriate.

Common problems and fixes

“The page shows content, but source is empty or sparse”

The content is probably rendered client-side, or the initial document is only an application shell. Inspect Elements and Network to find the API response or script that creates it.

“Source and Elements have different nesting”

Check for invalid or unclosed markup. The HTML parser may have repaired it. Validate the document and inspect the resulting DOM tree rather than assuming the source’s indentation represents the browser’s structure.

“I changed Elements, but the change disappeared”

DevTools edits are local and temporary. Reloading, navigating or rerunning the application restores the server response and script behavior. Change the application source or server template for a persistent fix.

“A script tag is in source, but nothing runs”

Use Console for exceptions and Network for a failed request, blocked MIME type, redirect, authentication problem or content-security-policy issue. A tag’s presence only proves that the browser received the reference.

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

“Find in source cannot locate a value”

Check casing, encoding and whether the value is assembled from smaller strings. Then inspect the live DOM and the responses that loaded after the document.

Capturing a reproducible page image or PDF

Source view is ideal for markup inspection, but a bug report often also needs a stable visual capture. You can use the browser’s print or screenshot functions manually; automated captures require a browser setup, loading waits and handling for consent banners and overlays.

Or skip the browser setup

ScreenshotNeo provides a GET-based screenshot API and MCP server. It accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and billing status.

Request a capture with cURL:

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

Python:

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

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for request options. It supports full-page captures with lazy images loaded, CSS-selector element shots, dark mode, 12 device presets and custom viewports, retina scale, PDF paper settings and page ranges, custom CSS or JavaScript, clicks, selector or network-idle waits, ad and tracker blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed image links, asynchronous webhooks, up to 100 URLs per bulk call, usage reporting and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.

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

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; all features are available on every plan. Create a free ScreenshotNeo account to begin.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and cost considerations

Source viewing itself is inexpensive because it displays the document already associated with the request. Runtime diagnosis can be slower: a page may wait on APIs, third-party scripts, fonts or lazy content. Capture tools add navigation, rendering and waiting time, so choose a selector, delay or network-idle condition that matches the page rather than using an unnecessarily long fixed delay.

For repeat captures, a chosen cache TTL can reduce work, while signed links and asynchronous jobs help when images are consumed by another system. Inspect verdict and billing headers when a capture fails so you can distinguish a blocked page, blank result, timeout, failed load or cache hit from a successful billed shot.

FAQ

Does View Page Source show the original file exactly?

It shows the document associated with the response as presented by the browser’s source viewer; transport decoding and display formatting can affect how it is shown, so treat it as the delivered markup rather than a server-side template file.

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

Can source view reveal private backend code?

No. It exposes data sent to the browser, not server-side application code, database queries or secrets that were never included in the response.

Why do two users sometimes see different source?

The server can return different documents based on authentication, cookies, locale, device, experiments or other request headers. Compare the request conditions before comparing source text.

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.