How em-dash replacement works
The pass is a single regex replacement: every U+2014 codepoint, the em dash (—), is rewritten as the ASCII hyphen-minus U+002D (-). No surrounding whitespace is changed, and no other characters are matched. A line like She paused — then becomes She paused - then, with the spaces around the dash preserved exactly.
Em dashes are common in AI-generated copy and modern word processors (Microsoft Word's autocorrect inserts them when you type two hyphens). They look fine in prose but break command-line output, regex anchors, and editors with limited Unicode support. Replacing them with hyphens normalises the text to plain ASCII.
En dashes (–, U+2013) are not touched by this pass. They are typographically distinct (used for ranges and connections) and stripping them is usually a separate decision. To handle them too, run find and replace with – as the pattern and - as the replacement. To remove non-ASCII characters wholesale, use remove non-ASCII.
How to use remove em dashes from text
- 1Paste copy that contains em dashes into the input panel on the left.
- 2Read the result with every em dash replaced by a hyphen.
- 3Inspect the surrounding whitespace, which is preserved as-is.
- 4Click Copy to take the normalised text.
- 5Run find and replace after if you also want en dashes converted.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
What this tool actually does
Single-codepoint regex replacement
The pass matches U+2014 (the em dash) globally and replaces each with U+002D (the ASCII hyphen-minus). Nothing else is matched. Implemented as s.replace(/—/g, '-'), so it runs in linear time even on huge inputs.
Surrounding whitespace preserved
Spaces, tabs, and newlines on either side of an em dash pass through unchanged. " — " becomes " - "; "a—b" becomes "a-b". The replacement is purely a character-level swap.
En dashes are not touched
U+2013, the en dash (–), is left in place. So 2020–2024 stays 2020–2024. To also replace en dashes with hyphens, follow this with find and replace on the en dash codepoint, or use remove non-ASCII to flatten everything beyond ASCII.
Existing hyphens stay verbatim
The match only fires on U+2014. Plain hyphens (-), minus signs, and other dash-like Unicode characters such as the figure dash and horizontal bar pass through. So a document that already mixes hyphens and em dashes ends up using only hyphens after this pass.
Runs locally on every keystroke
No upload, no server pass. The replacement fires in your browser as you type or paste, and the input panel shows live counts so you can confirm em dashes vanished. Nothing about your text leaves the page.
Worked example
Each U+2014 becomes -; the surrounding spacing is left exactly as it was, and en dashes elsewhere are not touched.
She paused — then continued — without looking up. Range 2020—2024.
She paused - then continued - without looking up. Range 2020-2024.
Settings reference
| Behaviour | Effect on output |
|---|---|
Em dash (—, U+2014) |
Replaced with ASCII hyphen-minus (-, U+002D). |
En dash (–, U+2013) |
Pass through unchanged. Use find and replace if you want it converted too. |
ASCII hyphen (-) |
Pass through unchanged. |
| Figure dash, horizontal bar, minus sign | Pass through unchanged. Only U+2014 is matched. |
| Surrounding whitespace | Preserved exactly. Spaces and tabs around an em dash stay where they were. |
| Letters, digits, punctuation | Pass through unchanged. |
FAQ
Does it also replace en dashes?
– as the pattern and - as the replacement to convert them.Will it remove the spaces around the em dash too?
Why would I want to remove em dashes?
What about hyphens that are already in the text?
-) pass through untouched. The match only fires on U+2014, so a document with mixed em dashes and hyphens ends up using only hyphens, with no double-replacement.