HTML tag filter
Strip HTML tags to get readable text, or keep the tags and remove their attributes; chosen tags or attributes can stay. Scripts never run.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Remove, Keep these tags or attributes, Remove empty lines and more
Run
Processes in this browser; cancel at any time
About this tool
Remove HTML tags to get the readable text of a web page, an email template or content copied from an editor. Or keep the tags and strip their attributes to clean up markup full of class and style attributes. In both modes you can name tags or attributes that should stay, such as links or images.
When extracting text, headings, paragraphs and list items start new lines, table cells are separated by tabs, and the contents of script and style elements are dropped. The HTML is only read as text, so scripts never run and nothing is fetched. Up to 1 MB is processed in your browser and is not uploaded.
How to use it
- Paste the HTML source, or select “Use example”.
- Under “Remove”, choose “Tags (get text)” or “Attributes (keep tags)”.
- In “Keep these tags or attributes”, list any to keep, separated by commas, such as a, strong or href, src. Leave “Remove empty lines” and “Trim spaces at line ends” on for tidier output.
- Select “Run”, then preview the result and download it: plain text as a text file, or an HTML file when tags remain.
Formats and limits
- Input
- Text
- Output
- Plain text, HTML
- Size limit
- 1 MB
- Settings
- Remove (Tags, Attributes); Keep these tags or attributes; Remove empty lines; Trim spaces at line ends
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
How do I keep links or bold text?
In “Tags (get text)” mode, list the tags in “Keep these tags or attributes”, such as a, strong. Kept tags are written back with all their attributes, the text around them stays HTML-escaped, and the result is saved as an HTML file.
What does “Attributes (keep tags)” do?
It keeps every tag, comment and piece of text and removes all attributes except the ones you list. Keeping href and src, for example, leaves links and images working while class, style and id go. Script and style elements stay too, only without their attributes.
What happens to scripts, styles and other hidden content?
When extracting text, everything inside script, style, noscript, template, iframe, object, svg and math elements is dropped, so CSS and code do not end up in the text. The tool only reads the HTML, so no script runs and no image or link is loaded.
Why are entities like & turned into characters?
When extracting text without keeping any tags, entities are decoded, so & becomes & and < becomes <. When you keep tags, the result is HTML, so the text stays escaped.
How is the extracted text laid out?
Block elements such as p, div, h1 to h6, li and tr start a new line, br becomes a line break and table cells are separated by tabs. Runs of spaces are collapsed except inside pre, and at most one blank line is kept between blocks, or none with “Remove empty lines” on.
Related tools
Code formatter
Format or minify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown, YAML, XML, SQL, C, C++, C#, Java, PHP, Python and nginx configuration.
HTML, CSS and JavaScript runner
Write HTML, CSS and JavaScript and see the page live with its console output, in an isolated frame.
Markdown editor
Write Markdown with a live preview, then download it as Markdown or a styled HTML page.
Text to HTML table
Turn CSV, tab-separated text copied from Excel, or text split by spaces or a custom character into an HTML table.
Convert dates and time zones
Convert one date-time per line between ISO 8601, Unix time and local time in named time zones. Daylight-saving gaps and repeats are reported.
Lunar calendar converter
Convert Gregorian dates to the Chinese lunar calendar with stem-branch year, zodiac, solar terms and festivals, or lunar dates (leap months marked 闰) back to Gregorian, one per line.