Remove em dashes from text

Remove em dashes from text by replacing every U+2014 character with an ASCII hyphen. Em dashes () often sneak into copy from word processors and AI-generated text; this pass swaps each one for a plain - so the result is portable across editors and code. En dashes () and existing hyphens are not touched. The transform runs in your browser, on every keystroke.

Input
Line 1:1 LF cloud_done Saved locally
Result Remove Em Dashes
0 lines 0 chars

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

  1. 1Paste copy that contains em dashes into the input panel on the left.
  2. 2Read the result with every em dash replaced by a hyphen.
  3. 3Inspect the surrounding whitespace, which is preserved as-is.
  4. 4Click Copy to take the normalised text.
  5. 5Run find and replace after if you also want en dashes converted.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun 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.

Input
She paused — then continued — without looking up.
Range 2020—2024.
Output
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?
No. Only the em dash (U+2014) is matched. En dashes (U+2013) are typographically distinct and used for ranges, so they are usually a separate decision. Run find and replace with as the pattern and - as the replacement to convert them.
Will it remove the spaces around the em dash too?
No. The pass only swaps the em dash codepoint for a hyphen. Spaces and tabs on either side stay exactly where they were. If you want to clean up double spaces around the new hyphen, follow with remove extra spaces.
Why would I want to remove em dashes?
Em dashes are inserted automatically by word processors and appear frequently in AI-generated copy. They render badly in monospace fonts and break command-line tools or regex patterns expecting ASCII. Replacing them with hyphens makes the text portable across editors, code, and plain-text systems.
What about hyphens that are already in the text?
Existing ASCII hyphens (-) 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.
Is the input ever uploaded?
No. The pass is a single JavaScript regex replacement evaluated in your browser on every keystroke. Nothing about the text you paste leaves the page or is logged.