Text Cleanup

Strip HTML Tags

Extract only the visible text from an HTML snippet.

Explanation

Removes all <tags> while keeping the content inside them.

Examples

HTML Link
Input
<a href="vaima.co">Visit <b>Vaima</b></a>
Output
Visit Vaima

Code Examples

Regex (Simple)
const plainText = html.replace(/<[^>]*>/g, '');

Try it Now

💡 Tips

  • Regex is good for simple tags but can fail on nested complex HTML
  • Use a proper parser like DOMParser in the browser for complex work
  • Remember to also unescape HTML entities like &amp;

⚠️ Common Pitfalls

  • Script and Style tag content might remain if you only remove the brackets