URL to HTML
Paste a web page link and see its HTML source code as the server sends it: highlighted, with line numbers, search, and pretty-print, plus the status, final address, charset, and size. Copy it or download the .html file.
How to view the source code of a web page
- Copy the address of a public web page and paste it above. On a phone or tablet, use your browser's Share or Copy link button. A "view-source:" address works too.
- Choose As sent for the exact source, Pretty-printed to read a minified page with one element per line, or Minified for the smallest version.
- Press View source. You get the HTML with colors and line numbers, and the status, content type, charset, size, and redirects of the answer.
- Find any text in the source with the search box (Enter for the next match), switch line wrap, then copy the source or download it as an .html file.
Questions and answers
Is this the same as view-source in my browser?
Yes, in the same sense: it shows the HTML the server sends, before any JavaScript runs, like Ctrl+U or view-source: in a desktop browser. It works where those are missing, such as Safari and Chrome on iPhone and iPad and most Android browsers.
Why is it different from what Inspect Element shows?
The inspector shows the live page after scripts have run and after the browser has fixed broken markup. This tool shows the source before that. Pages built with JavaScript (React, Vue, Angular apps) send little HTML, and the tool notes it when it sees that.
Why do I see a "Just a moment" or captcha page?
Some sites put a bot shield in front of their pages and show tools a browser check instead of the page. The tool says so when it recognizes one. It does not pretend to be a browser, so such pages can only be read in a browser.
Can the source differ from what I get in my browser?
Yes. The tool reads the page from a server, without your cookies or login, with its own honest name as the user agent, so a site may send a logged-out, regional, or simpler version. Error pages (404, 500) are reported with the status rather than shown.
What do Pretty-printed and Minified change?
Pretty-printed puts each block element on its own indented line and collapses spaces in text, so minified pages become readable. Minified removes comments and the spaces between tags. Both keep every tag, attribute, script, style, and preformatted text as sent; As sent changes nothing.
Is the shown HTML safe?
Yes. The source is shown as plain text: nothing in it runs, loads, or becomes a link, and the page allows only its own scripts. The downloaded file is the page's HTML; open it in a browser only if you trust the site.
Which pages can it read? Are there limits?
Public http and https pages that send HTML or XML (including RSS feeds, sitemaps, and SVG), up to 5 MB. One page per request; it never follows links or loads the page's scripts and images. It is free and needs no sign-up; each visitor can view a limited number of pages per minute.
Do you store the pages or my links?
No. The page is read once and sent back to your browser. Nothing is saved.
Can I use it from a script?
Yes. Open api/run?url=<page address>&format=text next to this page to get the source as plain text (add &view=pretty or &view=minify), or leave out format=text to get JSON with the source and the facts.
URL to HTML reads one public page per request and keeps nothing. Made with code.market URL tools.