View Page Source
Paste HTML source code to view with syntax highlighting, line numbers, search, and detailed stats
Paste raw HTML and get instant syntax highlighting, line numbers, tag stats, and in-source search. One click auto-indents minified markup so you can actually read it. And everything runs in your browser. Nothing gets uploaded.
How It Works
Paste your raw HTML into the input box and click "View Source." The tool parses the markup locally using JavaScript, applies color-coded syntax highlighting for tags, attributes, and values, then adds line numbers. The stats panel shows character count, line count, and tag breakdown. You can search for any string in the output, auto-indent messy code, or download the result as an .html file.
Examples
Checking Meta Tags on a Competitor's Landing Page
You grabbed the source of a competitor's homepage and need to see their Open Graph and description tags quickly.
<head><meta name="description" content="Best project management tool for teams"><meta property="og:title" content="TeamFlow"></head>
Color-highlighted source with line numbers, tag count (3 tags), and searchable "og:title" match
Debugging a Broken Email Template
Email HTML is notoriously ugly — inline styles everywhere, tables nested inside tables. You need to find a missing closing tag that's breaking the layout in Outlook.
<table><tr><td style="padding:20px"><table><tr><td>Hello</td></tr></table></tr></table>
Indented, color-coded view showing the <td> on line 3 is never closed — easy to spot with proper formatting
Learning from a Well-Built Website
You're studying how a popular site structures its header. Just paste and search for "nav" to jump straight to the navigation markup.
Full page source (~800 lines of minified HTML)
Search "nav" → 4 matches found, arrow buttons jump between them, highlighted in context
Who Uses This
Debugging production pages by inspecting the actual served HTML, not just DevTools' live DOM.
Checking meta descriptions, canonical tags, and structured data in competitor pages.
Reading real-world HTML with syntax highlighting to learn how professional sites are structured.
Pasting exported email HTML to find broken tables and missing closing tags before sending.
Common Mistakes
If you copy text from a webpage normally, you get the visible content — not the HTML. Right-click the page and choose "View Page Source" first, or press Ctrl+U (Cmd+Option+U on Mac) to get the actual markup.
This viewer doesn't download pages from URLs. It only works with source code you paste in. Grab the source from your browser first, then paste it here.
DevTools shows the live DOM after JavaScript has run. "View Source" shows the original HTML the server sent. They can be very different — especially on single-page apps where the initial HTML is nearly empty.
Technical Details
- Processing: 100% client-side — nothing is uploaded
- Browser Support: Chrome, Firefox, Safari, Edge
- Input Limit: No hard limit; performance depends on your device (tested with 50,000+ lines)
- Output Options: Copy to clipboard, download as .html, auto-indent
Frequently Asked Questions
How do I view the source code of a website?
Right-click anywhere on the page and select "View Page Source," or press Ctrl+U on Windows (Cmd+Option+U on Mac). That opens a new tab with the raw HTML. Copy everything, paste it into this tool, and you'll get a much cleaner view with colors and line numbers.
Is viewing page source legal?
Yes. Browsers serve the HTML to your device by design — you're just reading what was already sent to you. Viewing source is a standard part of how the web works. Using that information to copy someone's entire site is a different issue, but inspecting the code itself is perfectly fine.
What's the difference between View Source and Inspect Element?
"View Source" shows the original HTML that the server delivered. "Inspect Element" (DevTools) shows the live DOM after JavaScript has modified it. On a React or Vue app, the source might just be a single div, while Inspect shows the full rendered page. They answer different questions.
Can I view page source on my phone?
Mobile browsers don't have a built-in "View Source" option. The workaround: type view-source: before the URL in Chrome for Android, or use a bookmarklet. On iOS, there is no native way — your best bet is copying the page content and pasting it into a tool like this one.
Why does the source code look different from what I see on the page?
The browser applies CSS styling and runs JavaScript before showing you the final page. The source is just the raw instructions. Think of it like reading a recipe versus eating the finished meal — same content, very different experience. Dynamic content loaded via JavaScript won't appear in the source at all.