Identify ASCII Parentheses Codes

The ASCII values of ( and ) are 40 and 41 (hex 28 and 29). Learn how to confirm them, spot Unicode lookalikes, and how reversal or mirroring affects them.

The short answer

In ASCII, the left (opening) parenthesis has the decimal value 40 and the right (closing) parenthesis has the decimal value 41. In hexadecimal these are 28 and 29. Unicode keeps the same numbers for both characters, so they are U+0028 LEFT PARENTHESIS and U+0029 RIGHT PARENTHESIS.

Character | Decimal | Hex | Octal | Binary | Unicode code point | Unicode name
( | 40 | 0x28 | 050 | 00101000 | U+0028 | LEFT PARENTHESIS
) | 41 | 0x29 | 051 | 00101001 | U+0029 | RIGHT PARENTHESIS

Because both characters fall in the original 7-bit ASCII range, UTF-8 stores each as a single byte with the same value (0x28 and 0x29). UTF-16 stores them as the 16-bit units 0x0028 and 0x0029.

Related bracket codes for comparison

People looking up parentheses often need neighboring bracket characters too. These are also standard ASCII:

Character | Name | Decimal | Hex
[ | Left square bracket | 91 | 0x5B
] | Right square bracket | 93 | 0x5D
{ | Left curly bracket | 123 | 0x7B
} | Right curly bracket | 125 | 0x7D
< | Less-than sign | 60 | 0x3C
| Greater-than sign | 62 | 0x3E

Note that the opening and closing parentheses are adjacent (40 and 41), while square and curly brackets are separated by one character (92 is the backslash, 124 is the vertical bar).

How to confirm the code yourself

The most dependable way to identify a character is to ask a programming language or a code point inspector for its value, rather than trusting how it looks on screen. Built-in functions in common languages return the number directly:

# Python
ord("(")             # 40
ord(")")             # 41
hex(ord("("))        # '0x28'
chr(41)              # ')'

// JavaScript
"(".charCodeAt(0)                  // 40
"(".codePointAt(0).toString(16)    // "28"
String.fromCharCode(41)            // ")"

If a check returns something other than 40 or 41 for a character that looks like a parenthesis, you are dealing with a Unicode lookalike, not the ASCII character. When searching for an online inspector, useful terms include "Unicode code point lookup", "character inspector" and "identify Unicode character". No specific tool was evaluated for this article, so check any tool's output against a language built-in before relying on it, and do not assume anything about how a web tool handles pasted text based on its appearance.

Writing parentheses as escapes and entities

The same values appear in the escape syntaxes used by markup and programming languages:

HTML numeric:      &#40;   &#41;
HTML hex:          &#x28;  &#x29;
HTML5 named:       &lpar;  &rpar;
JavaScript/JSON:   \u0028  \u0029
Python:            \x28    \x29
Percent-encoding:  %28     %29

In regular expressions, parentheses are grouping metacharacters, so a literal parenthesis usually has to be escaped as ( and ), or matched with the hex escape \x28 and \x29 where the regex flavor supports it.

Lookalike parentheses that are not ASCII

Unicode contains several characters that resemble parentheses but have different code points. Text styling and "font" generators sometimes substitute them, and they also arrive through copy and paste from documents written in other scripts or layouts.

Looks like | Code point | Unicode name
( | U+FF08 | FULLWIDTH LEFT PARENTHESIS
) | U+FF09 | FULLWIDTH RIGHT PARENTHESIS
﹙ | U+FE59 | SMALL LEFT PARENTHESIS
﹚ | U+FE5A | SMALL RIGHT PARENTHESIS
⁽ | U+207D | SUPERSCRIPT LEFT PARENTHESIS
⁾ | U+207E | SUPERSCRIPT RIGHT PARENTHESIS
₍ | U+208D | SUBSCRIPT LEFT PARENTHESIS
₎ | U+208E | SUBSCRIPT RIGHT PARENTHESIS
︵ | U+FE35 | PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
︶ | U+FE36 | PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS

There are also single characters that include parentheses as part of the glyph, such as ⒜ (U+249C PARENTHESIZED LATIN SMALL LETTER A) and ⑴ (U+2474 PARENTHESIZED DIGIT ONE). These contain no separate 40 or 41 character at all.

Distinguishing clues: fullwidth versions take up noticeably more horizontal space in most fonts, superscript and subscript versions sit high or low and appear smaller, and vertical presentation forms are rotated. When the visual clue is subtle, the code point check is the only reliable test.

What reversal and mirroring do to parentheses

The words "reverse" and "mirror" describe different operations, and parentheses expose the difference clearly.

  • Character reversal changes the stored order of characters but not the characters themselves. Reversing "(a)" gives ")a(": the closing character now comes first, so the pair reads as backwards.
  • Mirror-text tools that aim for a mirrored look may additionally swap ( for ) and vice versa, so "(a)" becomes "(a)" again in appearance. Whether a given tool does this varies; test with a parenthesized sample before using it.
  • Bidirectional display mirrors parentheses visually without changing storage. Unicode marks U+0028 and U+0029 as mirrored characters and as a paired bracket set, so in right-to-left text the stored opening parenthesis is drawn facing the other way. The underlying code is still 40 for the opening character; only the glyph shown on screen is flipped.
  • Unicode substitution (the "font" effect) replaces the characters entirely, for example ASCII parentheses with superscript or fullwidth ones. The stored codes change, so a check returns values like U+207D instead of 40.

This is why the Unicode names "left" and "right" parenthesis are best read as "opening" and "closing" in mixed-direction text. A parenthesis that appears on the right side of a phrase in Arabic or Hebrew may still be the character with code 40.

When reversing longer strings, parentheses are not the only hazard. Combining marks and emoji built from several code points can be split apart by naive character-by-character reversal. The parenthesis examples above use only single-code-point ASCII characters, so they are not affected by that issue.

Will the result stay usable after copying or sharing?

Plain ASCII parentheses (40 and 41) are among the most portable characters available and are expected wherever parentheses carry meaning. Problems arise mostly when a transformation replaces or reorders them.

  • Code and data: programming languages, spreadsheets formulas, regular expressions and query syntaxes expect the ASCII characters. Fullwidth or superscript lookalikes are generally treated as ordinary symbols or rejected as invalid, so pasted code containing them will not run as intended.
  • Search and matching: a search for text containing ASCII parentheses may not match text containing lookalikes. Unicode compatibility normalization (NFKC) maps fullwidth, small, superscript and subscript parentheses back to 40 and 41, but whether a particular search box or database applies that normalization was not tested here.
  • Editing: reversed strings with backwards parentheses are confusing to edit, and bracket-matching features in editors look for the ASCII pair.
  • Assistive technology: how screen readers announce parentheses depends on their punctuation settings, and lookalike characters may be announced by unfamiliar names or not at all. No specific screen reader was tested for this article, so treat lookalikes as an accessibility risk until checked in your target setup.
  • Rendering: lookalikes depend on font coverage. A character that displays correctly in one app may appear as an empty box in another; a single successful rendering does not show it will work everywhere.

When styled or reversed text has to be shared, provide a plain-text version alongside it if the content matters, such as instructions, names, citations or anything people may search for or read aloud.

Is a parenthesis transformation suitable for your use?

Use plain ASCII parentheses (40 and 41) for code, data, formulas, documents, search-dependent text and anything read by assistive technology. Their benefit is near-universal recognition and correct behavior in tools that treat parentheses as syntax.

Lookalike or reversed parentheses are reasonable only for short decorative text where the visual effect is the point and nothing depends on the characters being parsed, matched or spoken correctly. The decisive tradeoff is that the visual change comes from altered or reordered character codes, which breaks searching, editing and accessibility in ways that are not visible on screen.

If you need parentheses to look correct in right-to-left text, rely on the standard characters and bidirectional display rather than manually swapping them; the rendering engine handles the mirroring while the stored codes remain 40 and 41.

Evidence gaps

The character codes, escapes and Unicode properties above are fixed by the ASCII and Unicode standards. No tests were run on specific apps, search engines, screen readers or text tools, so their handling of lookalike or reversed parentheses is described as a risk to verify, not as observed behavior.