Strip HTML Tags
Remove HTML tags from any text and keep only plain content.
Written by Anil Gautam · Updated
What happens to headings, lists and links when you strip HTML?
Every tag is deleted and the text between tags is kept. The sample on the page, a card holding a heading, a paragraph with a link and a two-item list, comes out as "Hello world", then "This is HTML with a link.", then "One" and "Two" on separate lines, with a blank line after the heading and after the paragraph. Bullets and list numbers disappear with their tags, and indentation from the source can remain at the start of a line.
The Keep link URLs option adds each address in brackets after the link text, so the paragraph reads "This is HTML with a link (https://oneclickuse.com)." It works only when the href value is in quotes and the link text is plain. A link wrapped around bold text or an image loses its URL. Relative links stay relative, so a link to /about reading "About us" becomes "About us (/about)". If you want headings and lists kept as structure, the HTML to Markdown Converter writes them in Markdown.
Which HTML tags become line breaks?
With Preserve line breaks on, a line break is added after closing p, div, h1 to h6, li and tr tags, and in place of every br tag. Table cells are not on that list, so a row with Name and City cells comes out as NameCity. Put a space or a line break between cells in the source if you need them apart.
Turning the option off keeps only the line breaks already typed in the source. Minified markup such as <p>One</p><p>Two</p> then becomes OneTwo, while the option on gives One and Two on separate lines. Either way, runs of blank lines shrink to one blank line and trailing spaces are removed from each line.
Which HTML entities are converted back to characters?
Six are converted: , &, <, >, " and '. Others, such as © or ’, stay in the output exactly as written, so search the result for an ampersand before publishing it. Escaped markup like <b> turns into a visible <b>, which matches what a browser would have shown.
The cleanup removes anything that starts with < and ends with >, so a bare less-than sign in ordinary text can swallow words: in "if a < b and c > d", everything from < to > disappears, leaving only "if a" and "d". A > inside an attribute value ends the tag early and leaves part of it in the output. Check the result carefully when the source is hand-written or broken HTML. All processing happens in your browser.