Extract text from HTML source
- Paste markup and choose readable boundaries or text-node concatenation.
- Review image-alt and hidden-subtree rules, then extract.
- Review plain text and parser diagnostics, then copy or download.
A pinned HTML parser builds a data tree inside a local worker. It does not create browser DOM elements, run scripts, apply CSS or fetch referenced images, frames, stylesheets or URLs. User markup and decoded output remain text in the interface. The parser handles entities, quoted attributes, malformed nesting and HTML recovery rules instead of stripping tags with a regex. parse5 project.
Extraction rules
Readable mode separates a fixed set of structural block tags with LF, keeps explicit br breaks, separates table-cell text with spaces and collapses HTML ASCII whitespace outside pre elements. Preformatted text retains parsed whitespace. Non-breaking spaces remain non-breaking-space characters. Lists become line-separated item text without generated bullets or inferred numbering. This is a deterministic text layout, not a screenshot or reproduction of computed browser layout.
Text-node mode concatenates eligible parsed text nodes in tree order without inserting block, line or cell boundaries and without whitespace cleanup. Image alt values can be added in either mode; other attributes, URLs, input values and CSS content are not included. Scripts, styles, head content, template, noscript, iframe, object and embed subtrees, plus comments and doctypes, contribute no text.
The optional hidden rule skips any subtree with a hidden attribute, including hidden="false". It does not evaluate style="display:none", CSS selectors, aria-hidden, media rules or JavaScript visibility. Such text may still be included. SVG/MathML text nodes can participate under the same rules; the tool does not render those formats.
Import and recover
Choose or drop one local .html, .htm or .txt file up to 400 KB. Files must be UTF-8; a different charset declaration does not change decoding. Initial BOM is removed and CRLF/CR becomes LF. Binary/control-character files are rejected. Invalid files keep your draft and result; editing cancels stale reads.
Live extraction waits 450 ms and pauses during input-method composition. Turn it off to run manually. Import, example, validated large paste and Clear offer one source undo step. Typing or changing extraction options discards it. Clear retains settings. Optional whitespace marks show only the first 1,000 code points and never enter exported TXT. A preview boundary can split a combined character.
Parser diagnostics and limits
HTML parsing decodes character references once, normalizes source CR/CRLF to LF and can replace or drop invalid HTML null characters according to parser rules. Recovery can move, insert or drop nodes. Diagnostics report the parser's count, including conditions such as a missing doctype in a fragment; they are not a validation or security verdict. The conversion is not an exact-source round trip, accessibility audit, sanitizer or plagiarism checker. Original source stays available separately. A decoded carriage return in preformatted or node text remains exact in Copy and Download; the read-only textarea displays normalized line breaks, with a result notice when this occurs.
Input at most 100,000 valid-Unicode UTF-16 units; tree at most 20,000 nodes and 512 levels; output at most 300,000 units. A ten-second worker timeout and Cancel terminate excessive work. Edits clear stale output. Original source TXT preserves the current textarea value, subject to browser CR/CRLF normalization. Unpaired surrogates reject for valid UTF-8 exports. No uploads, storage or external APIs. Clipboard copying is optional; download or select text if blocked.
Parser notices are preserved: parse5 licence and entity decoder licence.