How to Identify an Overscore (Overline) in Unicode

Find out which Unicode character produces an overscore in your text, from U+203E OVERLINE and U+0305 COMBINING OVERLINE to the macron look-alikes, and how to check it with a code point inspector.

An overscore, also called an overline or overbar, is a horizontal line drawn above text. In Unicode, several different characters can produce a line that looks like an overscore, and they behave differently when you search, sort, normalize or convert text. This guide explains how to find out exactly which character you have, using code point inspection, and how to confirm the result without accidentally changing the text.

What a code point inspector does for your text

A code point is the number Unicode assigns to each character, written as U+ followed by hexadecimal digits, for example U+203E. A code point inspector takes any text you paste or pass to it and breaks it into its individual code points. For each one it typically reports the code point number, the official Unicode character name and often properties such as the general category, which is the broad class of the character, such as letter, punctuation or combining mark.

Inspection is read-only: it reports what the text contains and does not change the text. That matters for overscores, because two strings that look identical on screen can contain different characters. An inspector shows that difference, while a visual check usually cannot. No specific inspector product was evaluated for this guide, so the descriptions here are of general behavior, not of any particular tool's features or accuracy.

Unicode characters that can look like an overscore

The characters below are the usual candidates. The names, categories and decompositions come from the Unicode Character Database. Exact appearance, including line length and height, depends on the font.

Code point | Glyph | Official name | General category | Role
U+203E | ‾ | OVERLINE | Po (punctuation) | Standalone overscore character; Unicode lists "spacing overscore" as an alternate name
U+0305 | ◌̅ | COMBINING OVERLINE | Mn (combining mark) | Draws a line above the preceding character
U+033F | ◌̿ | COMBINING DOUBLE OVERLINE | Mn (combining mark) | Double line above the preceding character
U+00AF | ¯ | MACRON | Sk (modifier symbol) | Standalone macron, often used as an overscore substitute
U+0304 | ◌̄ | COMBINING MACRON | Mn (combining mark) | Shorter accent-style line above the preceding letter, as in ā
U+02C9 | ˉ | MODIFIER LETTER MACRON | Lm (modifier letter) | Macron used as a letter-like mark, for example in tone notation
U+FFE3 |  ̄ | FULLWIDTH MACRON | Sk (modifier symbol) | Wide form used in East Asian typography
U+FE49 to U+FE4C | ﹉ ﹊ ﹋ ﹌ | DASHED, CENTRELINE, WAVY and DOUBLE WAVY OVERLINE | Po (punctuation) | Compatibility forms for East Asian text

The dotted circle ◌ in the table only shows where a base character would sit. It is not part of the combining characters.

Spacing versus combining overscores

The most important distinction is whether the overscore is a character of its own or a mark attached to another character.

  • Spacing characters, such as U+203E OVERLINE and U+00AF MACRON, take up their own position in the line. They appear as separate characters next to other text.
  • Combining characters, such as U+0305 COMBINING OVERLINE and U+0304 COMBINING MACRON, have no position of their own. Each one attaches to the character directly before it. For example, x̅ is stored as two code points: U+0078 LATIN SMALL LETTER X followed by U+0305 COMBINING OVERLINE.
  • To put an overscore over several letters with combining marks, each letter needs its own U+0305. Whether the separate marks join into one continuous line depends on the font and the program that renders the text.

As a rule of thumb, U+0305 is the character intended for a continuous overline across letters, as in a mathematical vinculum, while U+0304 is the accent used in languages that mark long vowels, such as ā. They can look similar in some fonts, so use the code point, not the shape, to decide which one you have.

Step by step: identify the overscore in your text

  • 1. Copy the exact text that contains the overscore, including the characters around it. With a combining mark, the base letter before it is part of what you need to inspect.
  • 2. Paste it into a code point inspector, or run one of the short scripts below.
  • 3. Read the list of code points in order. Note whether the line is a separate entry, such as U+203E or U+00AF, or a combining mark that follows a letter, such as U+0305 or U+0304.
  • 4. Compare the result with the table above to see which character it is and what it is meant for.
  • 5. Count code points against what you see. If one visible character shows up as two code points, a combining mark is involved.

Example: listing code points in Python

The following illustrative script uses Python's standard unicodedata module to print each code point with its category, combining class and name. The combining class is a number Unicode uses to order marks; 0 means the character does not combine, and 230 means a mark placed above the base character. The script has not been run for this article, so treat it as a starting point, not as verified output.

import unicodedata

text = "x\u0305 \u203E \u00AF"  # example input

for ch in text:
    cp = ord(ch)
    name = unicodedata.name(ch, "<no name>")
    category = unicodedata.category(ch)
    ccc = unicodedata.combining(ch)
    print(f"U+{cp:04X}  {category}  ccc={ccc}  {name}")

According to the Unicode Character Database, this input contains U+0078 LATIN SMALL LETTER X, U+0305 COMBINING OVERLINE with combining class 230, U+0020 SPACE, U+203E OVERLINE, another space and U+00AF MACRON. The exact output of your script depends on the Unicode version bundled with your Python installation.

Example: listing code points in JavaScript

JavaScript can list code point numbers but has no built-in way to look up character names, so compare the numbers against the table above. Iterating with for...of walks through code points rather than UTF-16 units. This snippet is illustrative and untested.

const text = "x\u0305 \u203E";  // example input

for (const ch of text) {
  const hex = ch.codePointAt(0).toString(16).toUpperCase().padStart(4, "0");
  console.log("U+" + hex);
}

Example: searching for any overscore-like character

To find every candidate at once, you can search with a character class that lists the code points from the table. This pattern uses Python regular expression syntax and is shown as an example only.

import re

overscore_like = re.compile("[\u00AF\u02C9\u0304\u0305\u033F\u203E\uFE49-\uFE4C\uFFE3]")

for match in overscore_like.finditer(text):
    print(match.start(), f"U+{ord(match.group()):04X}")

Avoid unintended changes: normalization

Normalization converts text into a standard form. The compatibility forms, NFKC and NFKD, replace some characters with simpler equivalents, and several overscore characters are affected. In the Unicode Character Database, U+203E OVERLINE has a compatibility decomposition to a space followed by U+0305 COMBINING OVERLINE, and U+00AF MACRON decomposes to a space followed by U+0304 COMBINING MACRON. The dashed and wavy overlines U+FE49 to U+FE4C decompose to U+203E, and U+FFE3 FULLWIDTH MACRON decomposes to U+00AF.

import unicodedata

before = "\u203E"
after = unicodedata.normalize("NFKC", before)
# Per the Unicode decomposition data, after is " \u0305" (space + combining overline)
print([f"U+{ord(c):04X}" for c in after])

If the overscore carries meaning, for example in a math expression, a product code or a historical transcription, inspect the text before and after any cleanup step. The canonical forms, NFC and NFD, leave these particular characters unchanged, but a tool that silently applies NFKC, or strips combining marks to remove accents, can change or remove the overscore.

When the inspector finds no overscore character

If you can see a line above text but the inspector lists only ordinary letters, the line is probably formatting rather than a character. Common sources include the CSS property text-decoration: overline, word processor formatting, MathML markup, or LaTeX commands such as \overline. In those cases the overscore exists only in the styling or markup, and copying the plain text will drop it. To keep it as plain text, you would need to add a character such as U+0305 after each letter.

Related entities and quick references

  • HTML named entity ‾ produces U+203E OVERLINE.
  • HTML named entity ¯ produces U+00AF MACRON.
  • Numeric character references work for any of them, for example ̅ for the combining overline.
  • In Python and JavaScript strings, \u203E and \u0305 insert the characters by code point.

Gaps in this guide

No evidence about specific inspection tools, their supported Unicode versions or their output formats was available, so no tool is recommended by name and no tool's accuracy is claimed. Font rendering, such as whether combining overlines connect across letters, varies by system and was not tested. The code samples are illustrations and should be run in your own environment to confirm their output.