Why Should You Remove Em Dashes (—) from Text?
Replacing em dashes (U+2014) with standard ASCII hyphens (U+002D) removes the most recognizable punctuation pattern of LLM-generated prose and prevents encoding errors in CLI flags, scripts, and legacy CMS databases.
In recent years, the telltale signature of AI-generated text has become the excessive use of em dashes (—). Whether you are humanizing AI drafts, formatting code snippets, or preparing copy for publishing systems that fail on non-ASCII characters, replacing em dashes with clean hyphens is essential.
What Unicode Dash Code Points Are Converted?
The regex rule s/[\u2012\u2013\u2014\u2015]/-/g maps all four Unicode general punctuation dashes directly to ASCII U+002D (-):
Text Cleaner normalizes all typographic dash variants into standard ASCII hyphens (-):
- Em Dash (
\u2014—): The standard long punctuation dash. - En Dash (
\u2013–): The medium-length range dash. - Figure Dash (
\u2012‒): The numeric width dash. - Horizontal Bar (
\u2015―): The quotation dash.
Worked Before / After Example: Input The quick brown fox—as they say—jumps over the “lazy” dog. (58 characters, 10 words, 2 em dashes U+2014) → Output The quick brown fox-as they say-jumps over the “lazy” dog. (58 characters, 10 words, 2 ASCII hyphens U+002D replaced, 0 surrounding characters altered).
| Dash Name & Unicode Code Point | Input Example (Before) | Output Result (After) | UTF-8 Bytes / Chars Changed |
|---|---|---|---|
Em Dash (U+2014 — → U+002D -) |
fox—as they say—jumps (21 chars, 25 bytes) |
fox-as they say-jumps (21 chars, 21 bytes) |
2 em dashes replaced (-4 UTF-8 bytes) |
En Dash (U+2013 – → U+002D -) |
pages 10–25 (2024–2026) (23 chars) |
pages 10-25 (2024-2026) (23 chars) |
2 en dashes replaced (-4 UTF-8 bytes) |
Figure Dash (U+2012 ‒ → U+002D -) |
555‒0199 (8 chars) |
555-0199 (8 chars) |
1 figure dash replaced |
Horizontal Bar (U+2015 ― → U+002D -) |
― Wait here (11 chars) |
- Wait here (11 chars) |
1 horizontal bar replaced |
How Is Surrounding Spacing Preserved During Dash Conversion?
The converter performs a strict 1-to-1 code point substitution without inserting or deleting spaces around the dash.
Text Cleaner preserves surrounding spacing exactly as intended: word—word becomes word-word, and word — word becomes word - word.