How to Convert HTML to Plain Text (Without Losing the Meaning)
HTML is built for browsers, not for reading in a plain text file. A web page mixes visible words with tags, attributes, styles, scripts, and navigation. When you copy that page into an email, a document, a spreadsheet, a note, or a plain text editor, the tags can come along with the words and make the result hard to read. Converting HTML to plain text means removing the markup while keeping the words, their order, and enough structure that a reader can still follow the meaning.
This guide explains a careful method for doing that conversion. It does not assume that you are a developer, and it does not require a particular tool. The same ideas apply whether you use a converter tool, a text editor, a spreadsheet import, or a small script. The goal is simple: keep the text that a person would see, keep paragraphs and lists readable, and remove everything that only told a browser how to display the page.
What HTML to Plain Text Conversion Really Means
HTML describes a document. Tags such as headings, paragraphs, lists, links, bold text, and tables describe structure. Attributes can add addresses for links and images, classes for styling, and data that is useful to a program but not to a reader. A browser turns all of that into a visual page. Plain text has none of that visual layer. It has characters, line breaks, spaces, and punctuation.
Because of that difference, conversion is not only deletion. If you delete every tag without thinking, you can join words that were separate, lose paragraph breaks, turn a list into one long sentence, or leave behind stray symbols. A good conversion replaces structure with simple text equivalents. A heading becomes a line on its own. A paragraph becomes a block separated by a blank line. A list item becomes a line that starts with a dash or a number. A link keeps its visible text, and, when the address matters, the address is added in a way that a reader can use.
It also helps to know what plain text cannot preserve. It cannot preserve color, font size, columns, hover behavior, or exact spacing. It cannot preserve an image itself, although it can preserve the image description if one is present. It cannot preserve a form that a reader is meant to fill in. If any of those features are essential, plain text is the wrong format, and you should keep the original HTML or use a PDF or another format that preserves layout.
How to Convert HTML to Plain Text
Follow these steps in order. They work for a short snippet, a blog post, a newsletter, or a full article.
Step 1: Start From a Copy
Never convert your only copy. Keep the original HTML file or page saved somewhere safe. If the conversion removes something you needed, you can start again. If the original is a live web page, save the page or copy the HTML into a text file before you change anything. This step also makes it easier to check your work later, because you can compare the plain text with the rendered page.
Step 2: Remove Scripts, Styles, and Hidden Content
Remove script and style blocks first. Scripts contain code, not readable content. Styles contain rules for appearance. Hidden content, such as navigation that is hidden on mobile, metadata, and comments in the code, should usually be removed as well. If you leave these parts in place, their text can appear in the middle of your article and confuse the reader. A converter tool usually handles this step for you. If you are converting by hand, look for script and style tags and delete the whole block, including the text between the opening and closing tags.
Step 3: Turn Structure Into Line Breaks Before You Remove Tags
Before you strip tags, replace block-level structure with line breaks. Put a blank line after each heading and paragraph. Put each list item on its own line. Put each table row on its own line and separate cells with a simple separator, such as a pipe character or a tab. Put a line break before and after a horizontal rule. This step is the one most people skip, and it is the reason many conversions come out as one large paragraph. Tags are easier to remove after their structure has been translated into spacing.
Step 4: Handle Links, Images, and Lists With Care
For a link, keep the visible link text. If the address is important, add it after the text in parentheses or in a list of references at the end. For example, a link that reads Read the guide could become Read the guide (https://example.com/guide). For an image, keep the alt text if it describes the image, and label it clearly, such as Image: A chart showing monthly sales. For a list, keep the order. A numbered list should keep its numbers when the order matters, such as steps in a process. A bulleted list can use dashes.
Step 5: Strip the Remaining Tags
Now remove the remaining tags. Inline tags such as bold, italic, span, and emphasis can be removed without adding line breaks, because they do not create new blocks. Check that removing a tag does not join two words. For example, if HTML has the words Hello followed by a tag and then World, removing the tag should leave a space if the original text needed one. After stripping tags, you will often see extra spaces, blank lines, or characters such as & that still need to be decoded. Fix those in the next step.
Step 6: Decode Entities and Clean Up Whitespace
HTML uses entities for characters that have a special meaning in markup. Common examples include & for an ampersand, < for a less-than sign, > for a greater-than sign, and " for a quotation mark. Decode these entities so the plain text shows the characters a reader expects. Then clean up whitespace. Collapse multiple spaces into one space, except where spacing is part of the meaning. Remove blank lines at the start and end. Keep one blank line between paragraphs, and avoid three or more blank lines in a row.
Step 7: Check the Output Against the Rendered Page
Read the plain text from start to finish. Compare it with the page as it appears in a browser. Check headings, paragraph order, lists, tables, links, and numbers. Read any sentences that cross a place where a tag was removed. Those are the places where words are most likely to be joined or split. If you find a problem, fix the source HTML or the conversion settings and convert again, rather than patching only the final text, because the same problem may appear elsewhere.
Worked Example
Suppose you start with this short HTML snippet:
<h2>Getting Started</h2> <p>Welcome to the guide. Please <a href="https://example.com/guide">read the full guide</a> before you begin.</p> <ul> <li>Save a copy of the original file.</li> <li>Remove scripts and styles.</li> <li>Check the output line by line.</li> </ul>
A careful conversion would produce this plain text:
Getting Started Welcome to the guide. Please read the full guide (https://example.com/guide) before you begin. - Save a copy of the original file. - Remove scripts and styles. - Check the output line by line.
Notice what was kept and what was changed. The heading stayed on its own line. The paragraph kept its sentence order. The link kept its visible text, and the address was added in parentheses because a reader of plain text cannot click the link. The list kept one item per line with a dash at the start. Nothing from the tags themselves remained, and no words were joined together.
Now consider a poor conversion of the same snippet. If a tool simply deletes every tag without adding line breaks, the result might look like this:
Getting StartedWelcome to the guide. Please read the full guide before you begin.Save a copy of the original file.Remove scripts and styles.Check the output line by line.
The words are all present, but the meaning is harder to follow. The heading runs into the first sentence. The sentences run into each other. The list has no clear items. This is why structure must be translated before tags are removed.
What Is Lost in Conversion
Some loss is normal. Links lose their clickable behavior. Images lose their visual detail. Tables lose their grid layout. Bold and italic text lose emphasis, unless you use simple markers such as asterisks or capital letters to show it. Colors and fonts are lost entirely. That does not mean the conversion failed. It means plain text is a simpler format, and you should choose it only when simple text is enough.
Other loss can be avoided. Paragraph breaks, list structure, heading order, and link addresses can all be preserved with care. If your output loses those, the conversion method needs to change. A common cause is a tool that treats the whole document as one string and removes tags without replacing block boundaries. Another cause is copying from a browser in a way that drops line breaks. In both cases, converting from the HTML source, rather than from a copied selection, usually gives a cleaner result.
Common Mistakes to Avoid
Do not paste raw HTML into a plain text file and call it plain text. The tags are still there, and a reader will see them. Do not paste HTML into an email or document and assume the receiving program will convert it cleanly. Some programs will show the tags, and others will strip them in a way that loses spacing.
Do not rely on a converter without checking its output. Tools differ in how they handle tables, nested lists, line breaks, and entities. A tool that works well for a simple article may fail on a page with complex layout. Do not remove link addresses without thinking. In a browser, a reader can click a link and see where it goes. In plain text, the address is often the only way to find the source again.
Do not forget to check numbers, dates, and names. These details are easy to damage when tags sit inside a sentence. For example, a price or a date that is wrapped in a span tag can lose its spacing. A quick read-through will catch most of these errors.
Limitations
Plain text conversion has clear limits. It is not a good way to preserve a page design, an interactive form, a chart, a video, or a complex table. It is not a good way to preserve content that depends on scripts, such as a calculator or a quiz. It is not a reliable way to preserve content that is loaded after the page first appears, because a simple converter may not see that content at all.
Conversion also depends on the quality of the source HTML. If the HTML is broken, if headings are used for visual size rather than structure, or if paragraphs are created with line breaks instead of paragraph tags, the plain text may not match the visual page. In those cases, fix the source HTML first, or accept that some manual cleanup will be needed. Finally, plain text does not preserve accessibility features such as link descriptions, labels, and landmarks in the same way that HTML does. If accessibility matters, keep the HTML version available.
Frequently Asked Questions
Does converting HTML to plain text remove all formatting?
Yes, in the sense that visual formatting such as fonts, colors, and layout is removed. Basic structure can still be shown with line breaks, dashes, numbers, and blank lines. That structure is a text approximation, not the same as the original formatting.
Will links still work in plain text?
Links will not be clickable in the same way, but many email and messaging programs will turn a full address into a clickable link. That is why it is often helpful to include the full address in parentheses or in a reference list when the link matters.
Can I convert a whole web page, including navigation and footers?
You can, but you may not want to. Navigation menus, sidebars, footers, cookie notices, and related links can add a lot of noise. It is often better to convert only the main article content, and to leave out repeated page furniture.
Is plain text safer than HTML for email?
Plain text avoids some HTML email problems, such as hidden tracking images, scripts, and broken layouts. It does not make an email safe by itself. You still need to check links, attachments, and the identity of the sender, just as you would with any message.
Conclusion
Converting HTML to plain text is a translation task, not just a deletion task. Keep the words, translate the structure into line breaks and simple markers, preserve link addresses when they matter, decode entities, and check the output against the rendered page. When you do that, the plain text version will be easy to read, easy to search, and faithful to the meaning of the original page.
Try a Tool
Free, in your browser — no sign-up.
Related Articles
How to Check an Image’s Dimensions Before You Upload It
Check an image's width, height, and file size before uploading, avoid upscaling, and test it on your site.
Read article →How to Take a Scrolling Screenshot of a Long Page
Learn how to take a clean scrolling screenshot of a long page, check the output, and avoid sharing private data.
Read article →How to Check a File Size Before You Download It
Check a file size before you download it. Learn MB vs KB, where size is shown, how to check storage, and when…
Read article →