What ASCII Character Is This? How to Identify Unknown and Lookalike Characters

Identify a mystery character by its code point, tell ASCII from Unicode lookalikes and invisible marks, and decide when to replace them with plain text.

When a character looks wrong, breaks a search, or makes two strings that look identical compare as different, the usual question is which character it really is. Often the honest answer is that it is not ASCII at all. ASCII covers only 128 code points, U+0000 through U+007F: basic Latin letters, digits, common punctuation and control codes. Anything outside that range is a Unicode character, and many of them are designed to look like ASCII. This guide explains how to identify the character, what replacing it actually changes, and when plain ASCII text is the safer result.

Is identifying and replacing the character the right move?

For most practical problems, yes. Looking up a character's code point and official Unicode name gives an unambiguous answer, and that answer is what you need to fix it. The main benefit is certainty: you stop guessing between a hyphen and an en dash, or a space and a no-break space. The decisive tradeoff comes after identification. Replacing a non-ASCII character with an ASCII lookalike can remove meaning that was intentional, such as an accent in a name, a typographic dash in edited prose, or a deliberate directional mark in mixed-language text.

Plain ASCII is preferable when the text will be processed by machines rather than read by people: source code, configuration files, command-line arguments, identifiers, usernames, URLs, CSV headers and anything that must match exactly in a search or comparison. Keep the original Unicode when the text is human-facing content in which the character carries meaning, such as names, non-English words, or mathematical notation.

What the character actually is: stored code points versus appearance

Every character in a string is stored as one or more code points. What you see on screen is a glyph chosen by a font. Two different code points can produce glyphs that look the same, and one visible character can be made of several code points. Identification means reading the stored code points, not trusting the glyph.

Several distinct situations tend to be described loosely as a strange character, a weird font or reversed text. They are different mechanisms. Unicode substitution swaps ASCII letters for other code points that resemble them, such as Cyrillic or mathematical letters; the stored text really is different. Invisible or formatting characters, such as zero-width spaces or directional marks, add code points that have no visible glyph. Combining marks attach to the preceding character, so one visible letter may be two code points. Bidirectional display can make stored text appear in a different visual order without any change to the stored order. CSS or rich-text styling changes only presentation and disappears when copied as plain text, while so-called font generators perform Unicode substitution and survive copying because the characters themselves have changed.

Common culprits that look like ASCII

What you see | Likely character | Code point | ASCII equivalent
A normal-looking space that will not split or match | NO-BREAK SPACE | U+00A0 | U+0020 SPACE
Nothing at all, but the string length is off | ZERO WIDTH SPACE | U+200B | remove it
Nothing visible, often at the start of a file | ZERO WIDTH NO-BREAK SPACE (byte order mark) | U+FEFF | remove it
A hyphen that is slightly too long | EN DASH | U+2013 | U+002D HYPHEN-MINUS
A longer dash | EM DASH | U+2014 | U+002D, or two hyphens
A minus sign in math text | MINUS SIGN | U+2212 | U+002D HYPHEN-MINUS
Curly single quote or apostrophe | RIGHT SINGLE QUOTATION MARK | U+2019 | U+0027 APOSTROPHE
Curly double quotes | LEFT and RIGHT DOUBLE QUOTATION MARK | U+201C and U+201D | U+0022 QUOTATION MARK
A Latin-looking lowercase a | CYRILLIC SMALL LETTER A | U+0430 | U+0061
A wide letter A | FULLWIDTH LATIN CAPITAL LETTER A | U+FF21 | U+0041
A bold A pasted from a font generator | MATHEMATICAL BOLD CAPITAL A | U+1D400 | U+0041
A diamond or box with a question mark | REPLACEMENT CHARACTER | U+FFFD | the original was lost; see below

Accented letters deserve a separate note. The letter é can be stored as a single precomposed code point, U+00E9, or as a plain e (U+0065) followed by COMBINING ACUTE ACCENT (U+0301). Both look the same, but they do not compare as equal unless the text is normalized first. Emoji behave similarly: a thumbs-up with a skin tone is U+1F44D followed by the modifier U+1F3FD, and many family and profession emoji are several code points joined by ZERO WIDTH JOINER (U+200D). If a tool reports more characters than you can see, this is usually why.

How to identify the character yourself

The most reliable method is to print each code point and its Unicode name. Python's standard library does this without any extra packages:

import unicodedata

text = "caf\u00e9\u200b"
for ch in text:
    print(f"U+{ord(ch):04X}", unicodedata.name(ch, "<no name>"))

For that input, the output lists U+0063 LATIN SMALL LETTER C, U+0061 LATIN SMALL LETTER A, U+0066 LATIN SMALL LETTER F, U+00E9 LATIN SMALL LETTER E WITH ACUTE and U+200B ZERO WIDTH SPACE. The last line reveals a character that is invisible on screen. Control characters such as tab have no Unicode name, which is why the fallback value is supplied.

In a browser console or Node.js, spreading a string iterates by code point rather than by UTF-16 unit, so characters outside the Basic Multilingual Plane, such as emoji and mathematical letters, are reported correctly:

[..."caf\u00e9\u200b"].map(c => "U+" + c.codePointAt(0).toString(16).toUpperCase().padStart(4, "0"))

To find every line in a file that contains any non-ASCII character, GNU grep with Perl-compatible patterns works in a UTF-8 locale:

grep -nP '[^\x00-\x7F]' file.txt

If you prefer an online checker, useful search terms are "unicode character inspector", "identify unicode character" and "show invisible characters". No specific site was verified for this article, so check that a tool shows the code point and official name rather than only a guess at the glyph. Do not assume anything about how a site stores or logs pasted text from its design or marketing; avoid pasting passwords, keys or private messages into a tool whose data handling you have not confirmed. Desktop operating systems also include character viewers that can show a character's name, but the location of that control varies by version and was not verified here.

Comparing two strings at the character level

When two pieces of text look identical but a comparison says they differ, a line-based diff is rarely enough, because the difference may be a single invisible or lookalike code point. Print the code points of both strings side by side using the snippets above, or use a diff tool that offers a character-level or hexadecimal view. The first position where the code points diverge is the answer. Normalizing both strings to the same form before comparing, such as NFC in Python with unicodedata.normalize("NFC", s), removes false differences caused by precomposed versus combining accents without changing anything else.

Will the cleaned or original text stay readable after copying?

Code points survive copy and paste between most modern applications, which is exactly why lookalikes cause trouble: the unwanted character travels with the text. Rich-text formatting such as bold or italics usually does not survive a paste into a plain-text field, whereas Unicode substitutes from font generators do, because they are different characters rather than styling.

Several practical limits follow from leaving non-ASCII lookalikes in place. Search and find features generally match code points, so a query typed in ASCII will not find a word written with Cyrillic or mathematical letters. Editing tools may treat a multi-code-point emoji or a combining sequence oddly when deleting or moving the cursor. Directional marks such as RIGHT-TO-LEFT MARK (U+200F) can change the visual order of surrounding text, so displayed text and stored text may not read the same way, which is a known risk in source code review.

Accessibility is the area where generalizing is least safe. Screen readers may announce substituted mathematical or styled letters by their symbol names, spell them out, or skip them, and behavior differs across products and versions. No scoped test with a named screen reader was available for this article, so if the text must be accessible, test it with the assistive technology your readers actually use, or provide a plain-text equivalent. For names, labels and anything that must be read aloud correctly, the plain-text version should be the primary one.

Converting to plain ASCII without losing meaning

Compatibility normalization (NFKC) converts many lookalikes automatically: fullwidth letters and mathematical bold letters become ordinary ASCII letters. It is not a pure cleanup step, though. It also turns a superscript two into a plain 2 and splits ligatures such as fi into separate letters, which can change meaning in formulas or technical text. It does not convert Cyrillic or Greek lookalikes, because those are real letters in other scripts, and it does not remove zero-width spaces.

  • Identify each non-ASCII character by code point before changing anything.
  • Remove invisible characters such as U+200B and a stray U+FEFF deliberately, not as a side effect.
  • Replace typographic quotes and dashes only where the destination requires ASCII.
  • Use NFKC for fullwidth and styled letters, then review the result for changed symbols.
  • Handle script lookalikes such as Cyrillic а by explicit replacement, and only when the word is meant to be Latin.
  • Leave accented letters and non-English text intact in human-facing content; normalize to NFC instead of stripping accents.

Gaps in this guide

No specific online tools, operating-system menu paths or screen-reader behaviors were verified for this article, so none are recommended by name. The code-point values, Unicode names and the Python, JavaScript and grep methods shown are standard documented behavior. If you need a decision for a particular destination, such as a specific social platform, editor or assistive technology, test the exact text there before relying on it.