Skip to tool
All tools

AI context cleaner

Paste HTML or text, get the part worth sending to an AI, and a token count.


Paste HTML or text to see the clean version and the tokens saved.

Everything runs in your browser. Nothing is uploaded.

Questions

What does this tool do?

The AI context cleaner takes a web page's HTML or a long text and keeps the part worth sending to an AI assistant: scripts, styles, menus, footers, sidebars, forms, cookie banners, ads and repeated boilerplate go; headings, paragraphs, lists, tables and code stay as readable text. An approximate token count shows what you saved.

What is removed?

Scripts and styles, navigation, headers and footers, sidebars, forms and buttons, iframes, cookie and consent banners, ads, pop-ups, newsletter boxes, share buttons, comment blocks, hidden elements, and short lines that repeat three times or more. Plain text only has its spaces and duplicate lines tidied.

What stays, and in what form?

Headings as hash lines, paragraphs as they are, lists as dash or numbered lines, tables as pipe rows, code blocks fenced and inline code in backticks, links as their text.

How are tokens counted?

Approximately: about four characters a token for Latin text, two for Chinese, Japanese and Korean, spaces not counted. Real tokenizers differ by model; the saving in percent is what matters.

How does it tell HTML from text?

Tags on more than one line, or a document tag such as html or body, count as HTML. Anything else is treated as plain text and only tidied.

Can it remove something I wanted?

It can. Removal goes by what the page calls things — a block named sidebar, promo, related or comments is dropped — so a page that misnames its content loses some of it. Read the result before you paste it.

Related tools