How to Insert a Line in Word Using Your Keyboard

How-to basics · Updated November 3, 2026

How to Insert a Line in Word Using Your Keyboard

To insert a horizontal line in Microsoft Word with your keyboard, put the cursor in an empty paragraph, type three hyphens (—), and press Enter. Word turns the characters into a line across the page. This is an automatic paragraph border, not a separate line shape, so use the steps below if you want to control where it appears or need to change or remove it.

What You’ll Need

  • Microsoft Word for Microsoft 365 on Windows, or a recent desktop version of Word. The keyboard method also works in many recent Mac versions when automatic border formatting is enabled.
  • A document in which you can edit the text, and a place where you can add a blank paragraph.
  • A keyboard. You do not need to open the Insert tab or use the mouse for the basic method.

Step-by-Step

  1. Place the cursor where the line should go. Click or use the arrow keys to move the insertion point to the intended location. If you want the line between two paragraphs, place the cursor at the end of the first paragraph and press Enter to create a new paragraph. The line belongs to a paragraph, so an empty paragraph gives you a predictable result.
  2. Make sure the paragraph is empty. If there is text in the paragraph, press Home and then Enter to create a separate paragraph before the text, or use the arrow keys to move to the position where you want a new blank paragraph. The exact result can vary when characters and a line command are in the same paragraph, so avoid adding the three hyphens after ordinary text.
  3. Type three hyphens. Enter the hyphen key three times in a row: ---. Do not add spaces between the hyphens. Use the regular hyphen key, not an underscore, en dash, or em dash. At this point you should see the three characters in the document.
  4. Press Enter once. Word’s AutoFormat feature recognizes the three hyphens and replaces them with a horizontal border at the bottom of the paragraph. The line usually extends across the available text width, between the page margins. The typed hyphens disappear; they have not been converted into a row of text characters.
  5. Check the line’s position. The new line is associated with the paragraph above it. If it appears beneath the wrong text, press Ctrl+Z immediately on Windows (Command+Z on Mac) to undo the conversion. Then put the cursor in the correct paragraph and repeat the sequence.
  6. Continue typing below the line. After the conversion, the insertion point is in the paragraph below the border. Type your next text there. If you need more space before the next text, press Enter to create another paragraph; do not type more hyphens unless you want another automatic border.
  7. Use a different character pattern for another border style, if supported. In Word for Windows, three underscores followed by Enter commonly create a heavier line, three equal signs create a double line, and three asterisks create a dotted line. Three tildes can create a wavy line. These are AutoFormat variations, not guaranteed in every configuration; use three hyphens for the standard, dependable line.
  8. Save and review the document. Check the line in Print Layout and confirm that it separates the intended content. If the document will be printed or shared, review it at the page size and zoom you expect to use, because the border follows the paragraph width and page margins.

This keyboard sequence is an easy way to insert a simple divider, but it is not a single Ctrl-based shortcut. The three hyphens and Enter trigger Word’s AutoFormat as You Type behavior. If the sequence remains as three typed characters, check that the automatic border option is enabled in Word’s settings.

Common Mistakes

  • Using an underscore instead of a hyphen: An underscore is a different character and may create a heavier border or leave the characters in place. For the standard line, type three regular hyphens.
  • Pressing Enter before typing the characters: Enter on its own only starts another paragraph. Type the three hyphens first, then press Enter to trigger AutoFormat.
  • Putting the characters in a paragraph with text: The automatic line is a border on a paragraph, not an independent object. If the paragraph contains text, Word may put a border under that whole paragraph, which can look as if the line is in the wrong place. Make a separate paragraph for the divider.
  • Expecting the line to behave like a drawn shape: The keyboard-generated line is attached to paragraph formatting. You cannot drag its endpoints like a shape. If you need a short line, a diagonal line, or precise placement, use Insert > Shapes and choose a line shape instead.
  • Deleting the line as though it were text: Backspace may remove text near the border without removing the border itself. Use the Borders controls to clear the paragraph border, as described in Troubleshooting.

Tips

  • Keep a blank line between sections: A border can make a useful section divider, but it may feel crowded if it touches text. Add a paragraph before or after it when you want more vertical space. Paragraph spacing can also be adjusted from Home > Line and Paragraph Spacing.
  • Use Undo for an immediate correction: If Word converts the characters in the wrong place, press Ctrl+Z on Windows or Command+Z on Mac right away. This restores the hyphens so you can move to the correct paragraph without rebuilding nearby content.
  • Know what the line is attached to: A paragraph border can move when you edit or rearrange nearby paragraphs. When you select the paragraph, the border settings apply to that paragraph. This attachment is why it is usually more stable than adding repeated underscore characters as text.
  • Use borders for consistent formatting: If you want the divider to match the document’s style, select the relevant paragraph and open Home > Paragraph > Borders. The Borders menu can apply or remove borders; Borders and Shading offers further choices, such as line style, color, and width.
  • Use a shape when the line must be independent: For a line that needs a specific length, angle, or position, choose Insert > Shapes > Line and draw it. That method is better for diagrams and forms, while the keyboard method is faster for a full-width section divider.

Troubleshooting

The three hyphens stay on the page. The AutoFormat option for border lines may be off. In Word for Microsoft 365 on Windows, go to File > Options > Proofing > AutoCorrect Options, select the AutoFormat As You Type tab, and enable Border lines. Click OK to close the dialogs, return to the document, and try the three-hyphen sequence in a new empty paragraph. If you are using Word for Mac, open Word > Settings (or Preferences in some releases) > AutoCorrect, then look for the AutoFormat As You Type options and enable border lines if that setting is available. Names and locations can vary slightly by release.

The line appears under the wrong paragraph. Undo the conversion first if possible: Ctrl+Z on Windows or Command+Z on Mac. Place the cursor in the paragraph that should carry the border, create a separate paragraph if needed, and try again. If the line has already been retained and you do not want to undo other edits, click in the paragraph directly above it and use Home > Paragraph > Borders. Choose No Border or the no-border option from the menu. In some ribbon layouts, the Borders button is in the Paragraph group and has a small arrow for its menu.

The line will not disappear when you press Backspace. It is likely a paragraph border rather than a text character. Click in the paragraph immediately above the line, open Home > Paragraph > Borders, and choose No Border. If the menu is difficult to identify, hover over the buttons in the Paragraph group to see their tooltips. Avoid selecting and deleting nearby text unless you intend to remove that text too.

The border looks too long or too short. The automatic line normally follows the paragraph’s available width, which is determined by the margins, indentation, and layout. To change the width, adjust the paragraph indentation or page layout, or use a line shape if you need exact endpoints. A paragraph border does not have draggable ends.

The line changes when you edit nearby content. Because it is paragraph formatting, moving, deleting, or merging paragraphs can move or remove the border. Click in the paragraph carrying the line and check Home > Paragraph > Borders. For a divider that must stay in a precise position independently of text, replace it with a shape and position the shape as needed.

Frequently Asked Questions

Is there a keyboard shortcut that inserts a line in one keystroke?
No single standard Ctrl shortcut inserts this automatic horizontal line in Word. The quick keyboard method is to type three hyphens in an empty paragraph and press Enter. It depends on AutoFormat as You Type being enabled.

Does the three-hyphen method work on a Mac?
It works in many recent Word for Mac versions if automatic border formatting is enabled. Type three hyphens in an empty paragraph and press Return. If nothing changes, check Word’s AutoCorrect or AutoFormat as You Type settings; the exact settings screen can differ by release.

How do I insert a line without converting the hyphens?
If you want three visible hyphens as text, undo the conversion immediately after it happens, or turn off Border lines in AutoFormat As You Type. You can also type the hyphens in a context where Word does not trigger the rule, but turning off the setting is more reliable when you need to keep repeated hyphen characters.

Can I make the line shorter?
Not by dragging the automatic border, because it is attached to a paragraph and spans that paragraph’s available width. Adjust the paragraph’s indentation to change the available width, or use Insert > Shapes > Line for a line with independently controlled endpoints.

How do I change the color or thickness?
Select the paragraph that owns the border, then open Home > Paragraph > Borders and Shading. Choose a line style, color, or width in the dialog and apply the setting to the paragraph border. The labels and dialog layout may vary slightly between Windows and Mac versions.

Will the line print?
Yes, a paragraph border normally prints as part of the document, unlike a nonprinting formatting mark. Check Print Layout or print preview before sharing to confirm the position and appearance. The line follows the paragraph width and page layout, so changing margins or indentation can affect its length.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.