Chinese Text Cleaner (中文文本清洗)
Clean pasted Chinese text and see every change
Chinese Text Cleaner (中文文本清洗)
What changed
Invisible and bidi control characters in the original
| Character (Unicode name) | Code point | Count | What happened | Remove |
|---|
What the tool leaves alone
Line breaks and paragraphs, tabs, indentation, runs of spaces, spaces between Chinese characters, apostrophes and inch marks in English, numbers like 3.14 and 12:30, and the joiners that hold emoji like 👨💻 together all stay, unless you switch on a rule made for them. Invisible characters that the script beside them needs are kept and flagged.
Three usual sources
| Source | What it does |
|---|---|
| Web or chat | Only the rules that leave the wording alone. |
| OCR | Also removes single spaces between Chinese characters, and fixes half-width punctuation after Chinese and full-width letters and digits. |
| PDF line breaks | Also joins hard-wrapped lines back into sentences. |
Which invisible characters it finds
Unicode 18.0.0 marks 4,174 code points as default-ignorable (Default_Ignorable_Code_Point): characters that normally show nothing. 405 of them are assigned. The tool reports every one it finds, by name and code point. The table lists the 49 that are neither variation selectors nor tag characters, and what the tool does with each by default; the 12 bidi controls (Bidi_Control) are among them, marked. The 260 variation selectors stay, because they choose a glyph, as in emoji and some Chinese characters. The 96 tag characters stay inside an emoji flag and go anywhere else, and an unassigned default-ignorable code point goes. Between two Chinese characters, all 49 are removed, unless the line has right-to-left text.
| Code point | Unicode name | By default |
|---|---|---|
| U+00AD | SOFT HYPHEN | Removed |
| U+034F | COMBINING GRAPHEME JOINER | Removed, unless beside a combining mark; then kept and flagged |
| U+061C | ARABIC LETTER MARK bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+115F | HANGUL CHOSEONG FILLER | Removed, unless beside Hangul; then kept and flagged |
| U+1160 | HANGUL JUNGSEONG FILLER | Removed, unless beside Hangul; then kept and flagged |
| U+17B4 | KHMER VOWEL INHERENT AQ | Removed, unless beside Khmer; then kept and flagged |
| U+17B5 | KHMER VOWEL INHERENT AA | Removed, unless beside Khmer; then kept and flagged |
| U+180E | MONGOLIAN VOWEL SEPARATOR | Removed, unless beside Mongolian; then kept and flagged |
| U+200B | ZERO WIDTH SPACE | Removed, unless beside a script written without spaces (listed below); then kept and flagged |
| U+200C | ZERO WIDTH NON-JOINER | Removed, unless inside an emoji or beside a script listed below; then kept and flagged |
| U+200D | ZERO WIDTH JOINER | Removed, unless inside an emoji or beside a script listed below; then kept and flagged |
| U+200E | LEFT-TO-RIGHT MARK bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+200F | RIGHT-TO-LEFT MARK bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+202A | LEFT-TO-RIGHT EMBEDDING bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+202B | RIGHT-TO-LEFT EMBEDDING bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+202C | POP DIRECTIONAL FORMATTING bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+202D | LEFT-TO-RIGHT OVERRIDE bidi | Removed, always |
| U+202E | RIGHT-TO-LEFT OVERRIDE bidi | Removed, always |
| U+2060 | WORD JOINER | Removed |
| U+2061 | FUNCTION APPLICATION | Removed |
| U+2062 | INVISIBLE TIMES | Removed |
| U+2063 | INVISIBLE SEPARATOR | Removed |
| U+2064 | INVISIBLE PLUS | Removed |
| U+2066 | LEFT-TO-RIGHT ISOLATE bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+2067 | RIGHT-TO-LEFT ISOLATE bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+2068 | FIRST STRONG ISOLATE bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+2069 | POP DIRECTIONAL ISOLATE bidi | Removed, unless its line has right-to-left text; then kept and flagged |
| U+206A | INHIBIT SYMMETRIC SWAPPING | Removed |
| U+206B | ACTIVATE SYMMETRIC SWAPPING | Removed |
| U+206C | INHIBIT ARABIC FORM SHAPING | Removed |
| U+206D | ACTIVATE ARABIC FORM SHAPING | Removed |
| U+206E | NATIONAL DIGIT SHAPES | Removed |
| U+206F | NOMINAL DIGIT SHAPES | Removed |
| U+3164 | HANGUL FILLER | Removed |
| U+FEFF | ZERO WIDTH NO-BREAK SPACE | Removed |
| U+FFA0 | HALFWIDTH HANGUL FILLER | Removed |
| U+1BCA0 | SHORTHAND FORMAT LETTER OVERLAP | Removed, unless beside Duployan shorthand; then kept and flagged |
| U+1BCA1 | SHORTHAND FORMAT CONTINUING OVERLAP | Removed, unless beside Duployan shorthand; then kept and flagged |
| U+1BCA2 | SHORTHAND FORMAT DOWN STEP | Removed, unless beside Duployan shorthand; then kept and flagged |
| U+1BCA3 | SHORTHAND FORMAT UP STEP | Removed, unless beside Duployan shorthand; then kept and flagged |
| U+1D173 | MUSICAL SYMBOL BEGIN BEAM | Removed |
| U+1D174 | MUSICAL SYMBOL END BEAM | Removed |
| U+1D175 | MUSICAL SYMBOL BEGIN TIE | Removed |
| U+1D176 | MUSICAL SYMBOL END TIE | Removed |
| U+1D177 | MUSICAL SYMBOL BEGIN SLUR | Removed |
| U+1D178 | MUSICAL SYMBOL END SLUR | Removed |
| U+1D179 | MUSICAL SYMBOL BEGIN PHRASE | Removed |
| U+1D17A | MUSICAL SYMBOL END PHRASE | Removed |
| U+E0001 | LANGUAGE TAG | Removed |
The zero width space (U+200B) stays beside: Thai, Lao, Khmer, Myanmar, Hiragana, Katakana
The joiners (U+200C, U+200D) stay beside: Arabic, Syriac, Nko, Mandaic, Mongolian, Hanifi Rohingya, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Tibetan, Myanmar, Khmer, Balinese, Javanese, Sundanese, Tai Tham
Also reported: special spaces (Unicode White_Space other than the ordinary space, tab and line breaks), such as NO-BREAK SPACE U+00A0, NARROW NO-BREAK SPACE U+202F and IDEOGRAPHIC SPACE U+3000, and BRAILLE PATTERN BLANK U+2800, which shows as a blank. No rule targets them as such, but a space rule that is switched on can remove some, such as “Drop spaces at line ends”, which is on by default; the result says how many went.
Frequently asked questions
The first deals only with things you cannot see, so the wording stays the same. The second changes the text, by joining sentences or removing links, so those rules start switched off.
When OCR has put a space between every character. The rule removes a single space between two Chinese characters, so a gap of two or more, as in a space-aligned table, stays. It would also join names written with spaces, like 张三 李四 王五, and a line of verse like 床前明月光 疑是地上霜, which is why it starts switched off.
Because the text beside it needs it. Unicode’s core specification (chapter 23) says the zero width space is meant for languages with no visible word spacing, such as Thai, Myanmar, Khmer and Japanese. So beside Thai, Lao, Khmer, Myanmar or Japanese kana it stays, as do the joiners in Arabic-script and Indic text such as Persian and Tamil. Each of these is listed in the result with an unticked box: tick it to remove it anyway. Joiners and selectors inside an emoji are listed too, but locked, because removing them would break the emoji apart.
They can make the screen show characters in a different order from the one stored, which is how the Trojan Source attack (CVE-2021-42574) hides code. Isolates can too: in Chromium, “Total 100 SGD due” with U+2067 before 100 and U+2069 after SGD displays as “Total SGD 100 due”. In a line with no right-to-left letters they have no other job, so they go. In a line with Arabic or Hebrew they may be doing real work, so they stay and are flagged, except the two overrides (U+202D, U+202E), which Unicode’s bidi algorithm (UAX #9) says “are to be avoided wherever possible, because of security concerns”.
A line ending in a full stop, question mark, exclamation mark, colon, semicolon, ellipsis or a closing quote or bracket stays. So does one followed by a blank or indented line. The rest join the line before.
A link ends at the first Chinese character, and punctuation closing the sentence stays. Names like Node.js and email addresses are not treated as links.
No, and neither do © and ™, unless they carry the variation selector that shows them as emoji. The tool follows Unicode’s emoji data.
Only a pair around Chinese changes. A straight ' or " right after a Latin letter or digit never opens a pair, and one right before a Latin letter or digit never closes one, so apostrophes and inch marks stay: John's 中文 Mary's and 身高 5'10" 和 6'2" come out as they went in. Pick “ ” or 「 」 and straight, curly and corner pairs all become that form. The mainland uses double quotes first, Taiwan corner brackets.
No. Everything happens in your browser.
Sources
Unicode Character Database 18.0.0 (Unicode License V3): DerivedCoreProperties.txt (Default_Ignorable_Code_Point), PropList.txt (Bidi_Control, White_Space, Variation_Selector), UnicodeData.txt (names), Scripts.txt, DerivedBidiClass.txt and DerivedGeneralCategory.txt; the tool’s list is built from these files. The Unicode Standard 18.0, chapter 23. Nicholas Boucher and Ross Anderson, Trojan Source: Invisible Vulnerabilities (arXiv:2111.00169, 2021); NVD, CVE-2021-42574. UAX #9, Unicode Bidirectional Algorithm, revision 52. Unicode emoji data (emoji-data.txt, emoji-variation-sequences.txt). W3C Requirements for Chinese Text Layout (clreq) on quotation marks.
Method & sources
How it computes
Each rule is a fixed text transformation that counts what it changed, and the page lists those counts. Rules work inside a line unless their purpose is lines, and tabs are never treated as spaces. Invisible characters follow Unicode 18.0 (Default_Ignorable_Code_Point, Bidi_Control): each one found is listed by name and code point, and one the script beside it needs is kept. Emoji follow Unicode's emoji data; quotes change only when a pair encloses Chinese. Nothing is sent anywhere.
What this tool implements
- Cut as false: the description of these rules as free of side effects, and the advice to enable everything for PDF text.
- Rules that change the wording start switched off, and every change is counted and listed for the reader.
Sources
- Unicode Consortium. emoji-data.txt: Emoji_Presentation, the list that decides what counts as an emoji. https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt
- W3C. Requirements for Chinese Text Layout (clreq), read 2 Nov 2026: first-level quotation marks on the mainland and in Taiwan and Hong Kong. https://www.w3.org/TR/clreq/
- Unicode Consortium. Unicode Character Database 18.0.0 (Unicode License V3): DerivedCoreProperties.txt (Default_Ignorable_Code_Point), PropList.txt (Bidi_Control, White_Space, Variation_Selector), UnicodeData.txt, Scripts.txt, extracted/DerivedBidiClass.txt and extracted/DerivedGeneralCategory.txt. The list the page reports from is built from these files. Read raw 2026-11-22: https://www.unicode.org/Public/18.0.0/ucd/
- Unicode Consortium. Unicode emoji data 18.0.0 (Unicode License V3): emoji-data.txt (Emoji_Presentation, Extended_Pictographic) and emoji-variation-sequences.txt (emoji style sequences). Read raw 2026-11-22: https://www.unicode.org/Public/18.0.0/ucd/emoji/
- Nicholas Boucher and Ross Anderson. Trojan Source: Invisible Vulnerabilities. arXiv:2111.00169, 2021. https://arxiv.org/abs/2111.00169
- NIST National Vulnerability Database. CVE-2021-42574 (Trojan Source, bidirectional control characters). https://nvd.nist.gov/vuln/detail/CVE-2021-42574
- The Unicode Standard, Version 18.0, Chapter 23, Zero Width Space: zero-width space characters "are intended to be used in languages that have no visible word spacing to represent word break or line break opportunities, such as Thai, Myanmar, Khmer, and Japanese." Read raw 2026-11-22: https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-23/
- Unicode Standard Annex #9, Unicode Bidirectional Algorithm, revision 52 (2026-09-01): the explicit directional overrides "are to be avoided wherever possible, because of security concerns." https://www.unicode.org/reports/tr9/tr9-52.html