HTML EXTRACTOR

Extract text from HTML

Fetch a public URL or paste HTML markup to strip tags, scripts, styles, and embedded frames—returning clean, readable body copy with word, character, line, and sentence counts.

How to extract readable text from HTML

To convert a live webpage or a raw HTML snippet into clean plain text, choose your input mode and run the extractor.

  1. Select the URL tab to fetch a public webpage's HTML response, or select the Text tab to paste HTML markup directly in your browser.
  2. Enter the public URL (or paste your HTML code) and select Extract Text.
  3. Read the extracted plain text in the Extracted Text workspace, or check the footer bar for live document telemetry: N words · N characters · N lines · N sentences.
  4. Select Copy to copy the plain-text string to your clipboard, or select Download to save the output as extracted-text.txt.

Reading your results: What is kept vs. what is stripped

Unlike naive regular-expression tag strippers that dump inline CSS rules and JavaScript variables into the output, HTML Extractor parses the DOM tree first, deletes non-content elements, preserves paragraph breaks around block elements, and decodes HTML entities:

HTML element or construct Action taken by HTML Extractor Why it matters for clean text output
<script>, <style>, <noscript> Completely removed from the DOM before serialization. Prevents inline JavaScript code, JSON state blobs, CSS rules, and noscript fallbacks from polluting your word count and body copy.
<svg>, <iframe>, <object>, <embed> Completely removed from the DOM before serialization. Strips inline SVG icon labels/paths and embedded frame fallback strings that are not part of the article prose.
Block tags (p, h1–h6, li, div, article, section, tr, blockquote, etc.) Wrapped with paragraph breaks, then normalized so consecutive blank lines collapse into a single clean break. Prevents adjacent headings, list items, and table cells from mashing together without spaces (e.g., turning <h1>Title</h1><p>Body</p> into TitleBody).
Inline tags (a, strong, em, span, code) & <br> Tags are removed while keeping inner text in flow; <br> becomes a single newline (\n). Keeps sentences intact across inline formatting links and emphasis tags.
HTML character entities (&amp;, &mdash;, &nbsp;, &#169;) Decoded to standard UTF-8 characters; non-breaking spaces (\u00a0) and tabs are normalized to regular spaces. Produces ready-to-paste copy without raw &quot; or &#39; sequences.
Tag attributes (href, src, alt, title, meta content) Not included in the output. HTML Extractor outputs visible DOM text nodes only—it is not a link, image, or metadata inventory tool.

If an input contains only tags, scripts, or SVGs with zero readable text nodes, the pane displays No readable text was found. and reports 0 words · 0 characters · 1 lines · 0 sentences.

Worked example: Converting messy HTML into structured plain text

Compare what happens when you pass a realistic HTML snippet containing inline styles, an SVG icon, entities, and headings into HTML Extractor:

<!-- Input HTML -->
<article>
  <style>.card { color: #333; }</style>
  <svg viewBox="0 0 24 24"><title>Decorative Icon</title></svg>
  <h1>Release Notes &amp; Upgrade Guide</h1>
  <p>Version 2.4 improves <strong>parser throughput</strong> by 35%.<br>Read the migration steps below.</p>
  <script>window.__ANALYTICS__ = { page: 'releases' };</script>
</article>

# Output in Extracted Text pane:
Release Notes & Upgrade Guide

Version 2.4 improves parser throughput by 35%.
Read the migration steps below.

# Footer telemetry:
15 words · 104 characters · 4 lines · 2 sentences

Notice three details in the result:

  1. The .card { color: #333; } CSS rule, the <svg><title>Decorative Icon</title></svg> text, and the window.__ANALYTICS__ script were completely discarded.
  2. The &amp; entity in the <h1> became a clean &, while the inline <strong> tag was stripped without breaking the spaces around parser throughput.
  3. The block-level <h1> and <p> are separated by a blank line, while the <br> inside the paragraph produced a single line break.

Common problems and fixes

If the extracted output differs from what you expected, check these common scenarios:

  • The output says No readable text was found. on a live URL.
    Cause: Either the target webpage renders all of its body copy on the client using JavaScript (leaving an empty <div id="app"></div> in the server HTML), or the markup consists entirely of canvas/SVG/iframe elements.
    Fix: Inspect the URL in View Source to see what the server actually returned. If the text only exists in the live browser DOM after JavaScript runs, copy the rendered inner HTML from your browser's DevTools Elements panel and paste it into the Text tab here.
  • You wanted to extract a list of URLs (href), image paths (src), or alt attributes.
    Cause: HTML attribute values are markup properties, not DOM text nodes (Node.TEXT_NODE), so extractReadableText ignores them.
    Fix: Use SEO Checker to audit link counts and image alt coverage, or use View Source to search attribute values in the markup.
  • Navigation menu and footer links appear in the extracted text when using URL mode.
    Cause: Unlike the Keyword Density Checker (which strips nav and footer to measure article prose repetition), HTML Extractor serializes all readable text inside document.body so you do not lose header, sidebar, or footer copy.
    Fix: If you only want a specific section's text, switch to Text mode and paste just the <main> or <article> HTML fragment.
  • You want to analyze word and phrase repetition percentages instead of just total word count.
    Cause: HTML Extractor reports total words, characters, lines, and sentences in the footer.
    Fix: Open Keyword Density Checker to get 1-to-4 word phrase frequency tables and vocabulary variety metrics.

How this check works

In Text mode, your pasted HTML is parsed locally in your browser memory and is never sent to a server. In URL mode, SolViewer retrieves the initial HTML document from the public URL you provide and passes that string to the same client-side parser.

The extractReadableText function parses the HTML into an inert DOM document via DOMParser (MDN DOMParser reference), deletes script, style, noscript, svg, iframe, object, embed elements, and recursively walks child nodes from document.body. Text nodes (`nodeType === 3`) are concatenated, `
` elements emit `\n`, and 35 standard HTML block elements emit surrounding paragraph breaks before consecutive blank lines are collapsed. All URL requests follow the SolViewer public retrieval limits.

Frequently asked questions

Is my pasted HTML sent to a server when I use Text mode?

No. When you select the Text tab and paste HTML markup, all parsing, tag stripping, entity decoding, and word counting run locally inside your browser tab. Only URL mode makes a network request to fetch the target webpage.

How does HTML Extractor count words, lines, and sentences?

After normalizing whitespace and collapsing extra blank lines, words are counted by splitting the non-empty text on whitespace (/\s+/), characters equal the string length, lines equal newline-separated rows (split('\n')), and sentences count non-empty segments split on terminal punctuation (/[.!?]+/).

Does HTML Extractor execute scripts inside the HTML I paste or fetch?

No. DOMParser().parseFromString(html, 'text/html') constructs an inert document that never executes <script> tags, inline event handlers, or external resource fetches, and all <script> nodes are deleted before text extraction.

Why are <svg> and <iframe> elements stripped from the text output?

Inline SVGs often contain internal <title>, <desc>, or coordinate text strings meant for icon rendering, and <iframe> tags only hold fallback text for legacy browsers. Removing them keeps the extracted prose clean for reading and editing.

What file format does the Download button save?

Selecting Download saves a UTF-8 plain-text file named extracted-text.txt containing the exact text shown in the workspace.

Related tools

  • View Source — inspect the full HTML markup (including the tags, attributes, and scripts that this tool strips).
  • Keyword Density Checker — analyze 1-to-4 word phrase frequency and vocabulary variety in your page copy.
  • HTML Viewer — render pasted HTML visually inside a sandboxed browser preview instead of stripping its tags.
  • SEO Checker — audit readable word count inside <main> alongside titles, headings, and technical SEO signals.

Public URL requests follow the shared fetch limits on the About page.