The easiest way to put a line over a letter in Word is the equation editor: press Alt + =, type the letter followed by \bar (for example, x\bar), and press the spacebar. Word displays x̄. For several characters, use \overline instead. Word doesn’t have an “overline” button like it does for underline, but special characters, Unicode codes, and a field code for longer text also work. A line over a letter shows up in statistics, logic, repeating decimals, and languages that use macrons.
Method 1: Use the equation editor
This works best for math and statistics.
- Click where you want the symbol and press Alt + =, or go to Insert > Equation.
- Type the letter, then \bar, and press the spacebar. For example, x\bar becomes x̄.
- To put a line over more than one character, type \overline(AB) and press the spacebar.
- Click outside the equation box to return to regular text.
You can also use the ribbon: on the Equation tab, click Accent and pick the Bar or Overbar option, then type inside the dotted box.
Equations use a math font, so they may look slightly different from the surrounding text.
Method 2: Add a combining overline with Alt + X
To keep the letter in your normal font, add a combining character after it:
- Type the letter, such as A.
- Immediately type 0305 (combining overline) or 0304 (combining macron).
- Press Alt + X. The code turns into a line above the letter.
Some fonts display combining marks better than others. If the line looks misaligned, try a font like Cambria, Calibri, or Segoe UI.
Method 3: Insert a letter that already has a macron
Vowels with macrons exist as their own characters, which look the cleanest in any font:
| Letter | Unicode code (type, then Alt + X) |
|---|---|
| ā / Ā | 0101 / 0100 |
| ē / Ē | 0113 / 0112 |
| ī / Ī | 012B / 012A |
| ō / Ō | 014D / 014C |
| ū / Ū | 016B / 016A |
You can also find them under Insert > Symbol > More Symbols, in the Latin Extended-A subset. If you type macrons often for te reo Māori, see how to insert Māori macrons in Word.
Method 4: Use an EQ field code
For a line over a whole word or a few letters in regular text:
- Press Ctrl + F9 to insert field braces { }.
- Inside them, type EQ \x \to(ABC), replacing ABC with your text.
- Press F9 to update the field. The text appears with a line over it.
Press Alt + F9 to switch between the code and the result if you need to edit it. Field codes are an older feature, so the equation editor is usually easier.
Which method should you use?
- Statistics or math: Equation editor.
- A single letter in normal text: Combining overline with Alt + X.
- Vowels in languages like Māori, Latin, or Hawaiian: Precomposed macron characters.
- Several letters in a sentence: EQ field code or \overline in an equation.
Will the line print correctly?
Yes. All of these methods print and export to PDF the same way they appear on screen.
Examples by subject
Statistics
The sample mean is written x̄ (read “x-bar”). Use the equation editor or the combining overline so the symbol stays attached to the letter when text reflows. For a sample proportion, p̂ uses a hat instead: type p\hat in the equation editor and press the spacebar.
Logic and digital electronics
A bar over a variable or expression means NOT, such as Ā or a bar over A + B. For a bar across a whole expression, use \overline(A+B) in the equation editor so one continuous line covers every character.
Repeating decimals
To show that digits repeat, as in 0.3̅ or 0.142857 with a bar over the repeating part, use \overline in an equation around just the repeating digits.
On a Mac
Word for Mac supports the equation editor (Insert > Equation) and Insert > Advanced Symbol. Alt + X isn’t available, but you can type macron vowels with Option + A, then the vowel, when using the ABC Extended keyboard input source.
Can I do this in Google Docs?
Yes. Google Docs has an equation editor under Insert > Equation that supports \bar and \overline, and you can insert macron letters from Insert > Special characters.
Related: How to insert symbols and special characters in Word.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.