Identify Unicode Underscore Characters

How to tell the ASCII underscore apart from Unicode look-alikes and combining low lines, what each one changes in stored text, and when to use plain U+005F instead.

An underscore that looks normal on screen may not be the character your keyboard produces. Unicode contains several low-line characters, combining marks that draw a line under other letters, and unrelated symbols that resemble an underscore. This guide explains how to identify which one you have, what each changes in the stored text, and when to replace it with the plain ASCII underscore.

Short recommendation

For anything a person or program must type, search, match or parse, use the ASCII underscore, U+005F LOW LINE. This includes usernames, file names, code identifiers, hashtags, URLs, database keys and form input. The other underscore-like characters give you a different look, such as fullwidth, dashed, wavy or tie-shaped lines. The decisive tradeoff is that they are different code points. A search for the ordinary underscore will not find them unless the software normalizes the text first, and a reader may be unable to retype them. Reserve them for decorative display where exact matching does not matter. If you want underlined text, use real formatting such as rich-text underline or CSS text-decoration instead of combining characters.

What counts as a Unicode underscore

In the Unicode Character Database, the ASCII underscore is named LOW LINE and belongs to the general category Pc, Connector Punctuation. Nine other characters share that category. Separately, some combining marks and symbols look similar but behave differently. The table lists the main candidates you are likely to meet, with their compatibility normalization (NFKC) result where one exists.

Code point | Unicode name | Category | NFKC result | Notes
U+005F | LOW LINE | Pc | unchanged | The standard ASCII underscore
U+FF3F | FULLWIDTH LOW LINE | Pc | U+005F | Wide form used in East Asian typography
U+FE4D | DASHED LOW LINE | Pc | U+005F | Compatibility form
U+FE4E | CENTRELINE LOW LINE | Pc | U+005F | Compatibility form
U+FE4F | WAVY LOW LINE | Pc | U+005F | Compatibility form
U+FE33 | PRESENTATION FORM FOR VERTICAL LOW LINE | Pc | U+005F | Intended for vertical text layout
U+FE34 | PRESENTATION FORM FOR VERTICAL WAVY LOW LINE | Pc | U+005F | Intended for vertical text layout
U+203F | UNDERTIE | Pc | unchanged | Curved tie below; not interchangeable with U+005F
U+2040 | CHARACTER TIE | Pc | unchanged | Curved tie above
U+2054 | INVERTED UNDERTIE | Pc | unchanged | Curved tie
U+2017 | DOUBLE LOW LINE | Po | space + U+0333 | Spacing double underline; not connector punctuation
U+0332 | COMBINING LOW LINE | Mn | unchanged | Draws a line under the preceding character
U+0333 | COMBINING DOUBLE LOW LINE | Mn | unchanged | Double version of U+0332

Other characters are sometimes mistaken for underscores or deliberately substituted for them. They include U+0331 COMBINING MACRON BELOW, U+02CD MODIFIER LETTER LOW MACRON and U+2581 LOWER ONE EIGHTH BLOCK. They are not low lines in Unicode terms, and normalization does not convert them to U+005F.

What each kind of substitution actually changes

There are three different mechanisms behind underscore-like text. It helps to separate them because the word "underline" is used loosely for all three.

  • Character substitution: the ASCII underscore is replaced by a different code point, such as U+FF3F or U+FE4F. The stored text changes. Software that compares exact characters treats the result as different text.
  • Combining marks: U+0332 or U+0333 is inserted after each letter, so each letter is drawn with a line beneath it. Generators that offer an "underline font" usually work this way. The stored text roughly doubles in code points, and every word is interrupted by marks.
  • Presentation formatting: an underline applied through rich text, HTML or CSS text-decoration. The stored characters stay the same, and only the display changes. When the text is copied into a plain-text field, the underline is typically dropped and the original letters remain.

"Font" is ambiguous in this context. A true font change affects how the same characters are drawn. Online "underline font" or "fancy underscore" tools usually change the characters themselves, which is why the effect survives pasting into places that have no formatting options.

Combining marks also affect reversal and editing. A combining low line attaches to the character before it. If a tool reverses a string code point by code point, the marks end up attached to the wrong letters or lead the string with nothing to attach to. Reversal that respects grapheme clusters keeps each letter and its mark together. The same unit matters when you delete or move the cursor through such text. The exact behavior depends on the editor.

Copying, sharing, search and accessibility

Because substituted characters and combining marks are part of the stored text, they generally survive copy and paste between applications that support Unicode. Whether they display correctly depends on the font available at the destination. A missing glyph may show as an empty box or a fallback shape. One successful rendering does not guarantee the same result in another app, browser, operating system or font.

  • Search and matching: a search for "user_name" will not match "user_name" or "user﹏name" unless the search system applies compatibility normalization. Combining underlines break words into letter-and-mark sequences, which can defeat search entirely.
  • Identifiers and code: languages that follow Unicode identifier rules (UAX #31) generally permit connector punctuation inside identifiers, so a look-alike underscore may be accepted but treated as a different name. Python is one documented exception, because it normalizes identifiers with NFKC under PEP 3131. In Python, a fullwidth underscore becomes U+005F, while an undertie stays distinct. Check the rules of your specific language before relying on either behavior.
  • Regular expressions: in Unicode-aware modes, \w commonly includes all Pc characters, not just U+005F. A pattern written for ASCII underscores may therefore accept look-alikes.
  • Assistive technology: how a screen reader announces an unusual low line, or a run of combining marks, depends on the product, its version and its punctuation verbosity settings. No scoped test results were available for this guide. If accessibility matters, test with the screen readers your audience uses, or provide plain text.

Provide a plain-text equivalent with ordinary letters and U+005F whenever the text must be found by search, entered by someone else, read aloud reliably, or processed by software. Decorative underscore styling is best kept to display copies where none of those needs apply.

How to identify the character you have

Look for these visual clues first. A line noticeably wider than surrounding letters suggests U+FF3F. A dashed or wavy line suggests U+FE4D or U+FE4F. A curved arc suggests U+203F or U+2054. A double line suggests U+2017 or U+0333. If every letter in a word sits on its own line segment, combining marks are the likely cause. Visual clues are only a starting point, because fonts vary. Confirm with a code point inspection.

Useful search terms include "Unicode character inspector", "code point lookup", "identify Unicode character" and the Unicode names themselves, such as "FULLWIDTH LOW LINE" or "COMBINING LOW LINE". No specific inspection tools were verified for this guide, so none are named. Any tool you use should show the code point in U+XXXX form and the official character name.

If you can run code, standard libraries can do the inspection without a third-party tool. In Python, the built-in unicodedata module reports each character's code point, category and name:

import unicodedata

text = "paste the suspect text here"
for ch in text:
    print(f"U+{ord(ch):04X}  {unicodedata.category(ch)}  {unicodedata.name(ch, '<unnamed>')}")

# Compatibility normalization folds fullwidth, dashed, wavy and
# vertical low lines to U+005F; undertie and combining marks remain.
print(unicodedata.normalize("NFKC", text))

In JavaScript, a Unicode-aware regular expression can flag any connector punctuation other than the ASCII underscore, and can list combining marks separately:

const text = "paste the suspect text here";

const lookalikes = text.match(/(?!_)\p{Pc}/gu) ?? [];
const marks = text.match(/\p{M}/gu) ?? [];

const toCodePoint = c => "U+" + c.codePointAt(0).toString(16).toUpperCase().padStart(4, "0");
console.log(lookalikes.map(toCodePoint), marks.map(toCodePoint));

To clean text for practical use, apply NFKC normalization to convert the compatibility low lines back to U+005F. Then remove or replace the remaining look-alikes and combining underlines explicitly, because normalization does not touch them. Review the result before using it in identifiers or file names, since NFKC also changes other compatibility characters in the same text.

Evidence gaps

Character names, categories and normalization mappings in this guide come from the Unicode Character Database. No destination-specific tests were supplied for particular platforms, social networks, fonts or screen readers. Statements about display and assistive technology are therefore general cautions rather than verified results. Test in the exact environment where the text will be used.