LLM responses are often littered with XML-style structure — <thinking>, <answer>, <context>,
<scratchpad> and any custom tag your prompt asked for. This tool strips or extracts that
structure so you get either clean user-facing text or just the inner content you actually want.
How it works
You paste a response and name the tags. The parser scans the text for matching <tag>...</tag>
pairs, correctly matching nested opening and closing tags, and then applies your chosen action:
- Strip tags only — keep the inner text, delete the angle-bracket markers.
- Strip tags and contents — delete the whole block, including everything inside.
- Extract contents — return only the inner text of matching tags, discarding everything else.
Everything runs in your browser. Nothing is uploaded, so confidential prompts stay private.
When you actually need this
Pipeline cleaning. You ask Claude or another model to reason step-by-step in <thinking> tags and then give the final answer in <answer> tags. Your backend needs to store or display only the answer. Without a stripper you have to write a regex every time — and regexes for nested tags get messy fast.
Logging sanitisation. Your internal logs should never store a user’s private reasoning trace. Strip tags and contents to discard <scratchpad> blocks before writing to your database.
Structured extraction. A document-QA pipeline wraps retrieved passages in <context> tags. You want to pull just those passages as clean text. Set the action to Extract and the tag to context.
Worked examples
Scenario 1 — hide reasoning, keep answer. The model returns:
<thinking>I should check whether the sum is correct…</thinking>
<answer>The total is $42.</answer>
Tag: thinking · Action: Strip tags and contents. Output: <answer>The total is $42.</answer>. Then run again with tag answer, action Strip tags only to get: The total is $42.
Scenario 2 — extract multiple context blocks.
A RAG response contains several <context> passages scattered through the completion. Tag: context · Action: Extract contents. Output: the inner text of every context block concatenated, discarding all prose between them.
Common mistakes and edge cases
- Blank tag field acts on every tag detected — useful for a full-strip pass, but be careful if the model’s answer itself contains angle brackets used as comparison operators (
<and>), which the parser may try to match as tags. - Nested same-name tags (
<thinking>…<thinking>…</thinking>…</thinking>) are handled correctly; the tool pairs each opener with its matching closer. - Partial blocks — if the model was cut off and a
<thinking>was never closed, the tool leaves the trailing text verbatim rather than deleting an unmatched opener.