How to Stop Google Docs from Automatically Changing Hyphens to Em Dashes

What is an Em Dash?

When typing in Google Docs, you will notice that the software automatically attempts to format your punctuation. If you type two standard hyphens back-to-back ( -- ) and press the spacebar, Google Docs will immediately intercept those characters and merge them into a single, long, continuous line called an Em Dash ( — ).

In formal typesetting and novel writing, an Em Dash is the correct punctuation mark for indicating a sudden break in a sentence. However, if you are using Google Docs to write code documentation, command-line arguments (like git commit --amend), or simple ASCII art, this automatic conversion will completely destroy your syntax. Pasting an Em Dash into a terminal will result in an immediate error. You can disable this automatic substitution.

How to Stop Automatic Em Dash Conversion

You can turn off this specific text replacement rule in the Google Docs Preferences menu.

  1. Open your web browser and navigate to any open document in Google Docs.
  2. At the top of the screen, click on the Tools menu.
  3. Scroll down the dropdown list and click on Preferences.
  4. A popup window will appear with two tabs at the top. Click on the Substitutions tab.
  5. This tab displays a list of every single automatic text replacement rule. Scroll down the list until you find the row where -- is replaced with —.
  6. Click the checkbox on the far left side of that specific row to remove the checkmark.
  7. Click the blue OK button at the bottom of the window to save your changes.

From now on, whenever you type two hyphens, Google Docs will leave them exactly as you typed them, ensuring your command-line flags and technical notes remain perfectly accurate.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.