Tools

Home
Regex TesterHash GeneratorURL Encode/DecodeEncrypt/DecryptJSON Path TesterFavicon Downloader

View Page Source

Paste HTML source code to view with syntax highlighting, line numbers, search, and detailed stats

Your files never leave your browser
Input0 chars, 0 lines
Lines: 0Chars: 0Tags: 0<script>: 0<style>: 0<link>: 0<img>: 0
Highlighted Source
Ready·

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 HTML
➔
Parse & Highlight
➔
View & Search

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.

INPUT
<head><meta name="description" content="Best project management tool for teams"><meta property="og:title" content="TeamFlow"></head>
OUTPUT
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.

INPUT
<table><tr><td style="padding:20px"><table><tr><td>Hello</td></tr></table></tr></table>
OUTPUT
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.

INPUT
Full page source (~800 lines of minified HTML)
OUTPUT
Search "nav" → 4 matches found, arrow buttons jump between them, highlighted in context

Who Uses This

👨‍💻 Web Developers

Debugging production pages by inspecting the actual served HTML, not just DevTools' live DOM.

📈 SEO Specialists

Checking meta descriptions, canonical tags, and structured data in competitor pages.

🎓 Students

Reading real-world HTML with syntax highlighting to learn how professional sites are structured.

✉️ Email Developers

Pasting exported email HTML to find broken tables and missing closing tags before sending.

Common Mistakes

Pasting the rendered text instead of source code

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.

Expecting the tool to fetch a URL for you

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.

Confusing "View Source" with browser DevTools

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

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.

Share: