toolbench.onlineby Valkyron Labs

Text

HTML to Plain Text

Pull the words out of a pasted HTML page, email, or snippet so you get plain text, with paragraph breaks and the link text you decide to keep.

HTML to Plain Text

Extract plain text from HTML, with paragraph breaks and link handling.

Ready to run.

Plain text

—

Output actions

Ready to copy output once your result appears.

Visible words, with the breaks you keep

HTML to Plain Text reads HTML input and writes Plain text. Collapse whitespace and Preserve line breaks start checked. Links starts on Keep link text. Strip HTML runs the conversion. Load sample fills a two-paragraph fragment and does not strip until you press the button. Reset clears the box and the result and leaves the three controls as they are. Copy output and Download output use the latest Plain text. The download file is html-to-text.txt.

How to turn HTML into plain text

  1. 1Paste markup into HTML input, or press Load sample. The sample is a paragraph Hello & welcome. and a second paragraph whose link text is Example. The placeholder is an h1 and a paragraph.
  2. 2Leave Collapse whitespace and Preserve line breaks checked unless you want the raw spacing or a single line. Set Links to Keep link text, Include link URL, or Remove links.
  3. 3Press Strip HTML. A success says Converted successfully. An empty box says Please enter HTML to convert. Changing a checkbox does not rerun. Press Strip HTML again.

What it is good for

  • • Turning a copied email or CMS fragment into words you can paste into a draft.
  • • Keeping the blank line between two paragraphs while the tags disappear.
  • • Appending a link's href, or dropping the link text entirely, without opening the page.

Example

Input

<p>Hello &amp; welcome.</p><p>Visit <a href="https://example.com">Example</a>.</p>

Output

Hello & welcome.

Visit Example.

Load sample, leave both checkboxes on and Links at Keep link text, then press Strip HTML. Include link URL makes the second paragraph Visit Example (https://example.com). with the period after the parenthesis. Remove links makes that paragraph Visit .

What is left after the tags go

The markup is parsed in a detached template, so nothing is inserted into the page and no script runs. script, style, noscript, iframe, object, embed, and template elements are removed before the text is read. Named and numeric entities are decoded by that parser. &amp; becomes &, &copy; becomes ©, and &#x1f600; becomes 😀. A fragment with a script, a style, a paragraph A &copy; &#x1f600; then a br then B, and a second paragraph whose link text is Link, becomes A © 😀, a line break, B, a blank line, and Link when breaks are kept and links keep their text.

br becomes a newline. p, div, headings h1 through h6, li, tr, blockquote, pre, section, and article each gain a newline before and after. Other tags contribute their text without those extra breaks. A span inside a paragraph stays on the paragraph's line. The page does not apply CSS, so a heading that only looks separate because of margin is separate here only when the element is one of those blocks. Source order is the order of the words. A two-column layout that reads across in the browser still reads down the markup.

Collapse whitespace, Preserve line breaks, and Links

Collapse whitespace starts checked. It trims each line, turns runs of spaces, tabs, and non-breaking spaces into one space, collapses three or more newlines into a blank line, and trims the whole result. Hello followed by three spaces and world, inside one paragraph, becomes Hello world. Uncheck it when those spaces are the content. Preserve line breaks starts checked and keeps the newlines the blocks and br tags produced. Uncheck it and every whitespace run, including the blank line between paragraphs, becomes a single space. The sample then prints Hello & welcome. Visit Example. on one line. Collapse still runs first when it is checked, but the final join removes the line structure either way.

Links starts on Keep link text, which leaves the visible words and drops the href. Include link URL appends a space, an opening parenthesis, the literal href attribute, and a closing parenthesis after the link text. The sample's Example becomes Example (https://example.com). A relative href such as /x stays /x, because no base URL is assumed. Remove links deletes the anchor, text included. The sample's second paragraph is then Visit . with the period that sat outside the anchor. The three controls apply on the next Strip HTML. Load sample and Reset do not change them. Reset does clear Plain text.

When the words are the copy you want

Use this page when you already have markup and you want the words a reader would see, plus the breaks those blocks imply. A newsletter source, a CMS export, or a table cell you copied as HTML fits. Indenting the tags is a different job. The HTML beautifier reindents markup and keeps the tags. Writing Markdown and wanting tags is Markdown to HTML. This page never emits tags.

A paragraph that was hard-wrapped inside the text, rather than with tags, is still several lines here if the source contained line breaks and Preserve line breaks is on. Line operations can join those wraps afterward and can keep a blank line as a paragraph gap. The pasted-list guide is about rows you already have as text. Paste here first when the rows are still wrapped in tags. This page does not fetch a URL. Paste the source.

Scripts, entities, and a link you removed

A script's text does not appear, including a script that was written as the body of the element rather than as a src. The same is true of a style sheet. That removal is why evil() in a script tag is absent from the plain text. The parser still repairs broken markup the way a browser would. An unclosed paragraph can swallow the next words, and the line breaks follow the repaired tree. If the text looks nothing like the rendered page, compare the source order and look for elements this page treats as blocks.

An empty box, or a box that trims to nothing, says Please enter HTML to convert. A box longer than 1,000,000 characters fails inside the converter and the result is cleared. The page does not download images or follow an href. Include link URL prints the attribute, even when it is javascript: or a data URL. Remove links is the choice when that text should not be in the paste. Entities that are already decoded in the source stay as characters. A literal &amp;amp; is an ampersand followed by amp; after one decode, which is what the parser does.

Rules and limitations

Parsing uses a detached template. script, style, noscript, iframe, object, embed, and template are removed. Entities decode. Blocks and br create newlines. Collapse whitespace starts on and shortens spaces and blank-line runs. Preserve line breaks starts on. Off, the result is one line.

Links: Keep link text, Include link URL with the href in parentheses, or Remove links including the link text. Relative hrefs stay relative. Strip HTML is required after a control change. The page does not fetch URLs. Copy and download are the plain text.

Common problems

If a sentence lost the middle words, Links is Remove links and those words were the anchor. Switch to Keep link text and press Strip HTML again.

If the paragraph break vanished, Preserve line breaks is off. If a script's source appeared, it was not inside a script element. If the words follow the markup instead of the visual columns, that is source order.

Frequently asked questions

Are paragraph breaks kept?

Yes, while Preserve line breaks is checked. Two paragraphs become two blocks separated by a blank line. Uncheck it and the same sample becomes one line.

Can the href be included?

Yes. Include link URL appends the href in parentheses after the link text. A relative href is not rewritten against a base.

Will a script in the paste run?

No. The markup is parsed in a detached template and script elements are removed before the text is read.

Can I paste a page URL?

No. Paste the HTML source. This page does not download a page, and it does not follow links.

Is my input uploaded or saved?

This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.

About this tool

Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.

Guides

Next steps

Related tools

Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.

Trust

Policies, contact, and answers

Clear pages for how Toolbench works, what we collect, and how to reach us.