DeepSeek <think> Tag & Reasoning Block Remover
Strip <think>...</think> reasoning traces, orphaned tags, and citations from DeepSeek-R1 and V3 outputs.
const cleaned = text.replace(/<think>[\s\S]*?<\/think>\s*|<\/think>/gi, '');
$...$), Markdown data tables, and ISO-8601 timestamps are strictly preserved.
Deterministic Sanitization Specification & Live Diff
<think>Let's analyze Fourier's law of thermal conduction.First, calculate the temperature gradient dT/dx.</think>### Conduction SummaryAccording to **Fourier's Law**, conductive heat flux [1] is directly proportional to the temperature gradient.Conduction SummaryAccording to Fourier's Law, conductive heat flux is directly proportional to the temperature gradient.How to Clean DeepSeek <think> Tag & Reasoning Block Remover Online
ClipNText DeepSeek <think> Tag & Reasoning Block Remover is a client-side text sanitizer that strips DeepSeek Chain-of-Thought (<think>) Wrappers, orphaned delimiters, and syntax clutter from ai. Executing locally via asynchronous browser Web Workers (scrub.worker.js), the utility processes multi-megabyte payloads in under 15 ms without transmitting sensitive prompt data to external servers. Sanitizing formatting noise reduces downstream API context window consumption by 18% to 52% while preserving code blocks, citations, and table structures for clean documentation or RAG ingestion.
| Target Artifact | Regex / Pattern Signature | Sanitization Behavior |
|---|---|---|
<think>
Let's analyze Fourier's law of therma |
/<think>[\s\S]*?<\/think>\s*|<\/think>/gi |
DeepSeek-R1 and distilled reasoning models stream their internal chain-of-thought tokens wrapped in <think>...</think> XML blocks before producing final prose. |
Conduction Summary
According to Fourier' |
/[ \t]{2,}|\u200B/g |
Collapses redundant whitespace and purges invisible zero-width tokens. |
DeepSeek Chain-of-Thought (<think>) Wrappers
DeepSeek-R1 and distilled reasoning models stream their internal chain-of-thought tokens wrapped in <think>...</think> XML blocks before producing final prose.
/<think>[\s\S]*?<\/think>\s*|<\/think>/gi
Technical Edge-Case FAQ
Common engineering questions regarding character preservation, encoding boundaries, and browser worker performance: