ASCII code for apostrophe
39
Apostrophe — '
| Decimal | 39 |
| Hexadecimal | 0x27 |
| Octal | 0047 |
| Binary | 00100111 |
| HTML entity | ' |
| String escape | \' |
What it is
Apostrophe is one of the 95 printable ASCII characters, the set every text encoding in common use still agrees on. UTF-8 encodes it as the single byte 39, which is why ASCII text is also valid UTF-8.
The full entry
ASCII 39 in full — the code point page, with what sits either side of it and how the character is encoded elsewhere.
Frequently asked questions
What is the ASCII code for apostrophe?
The ASCII code for apostrophe is 39 in decimal, 0x27 in hexadecimal and 0047 in octal.
What is apostrophe in binary?
00100111 — eight bits, though ASCII only defines seven, so the top bit is always zero.
How do I write apostrophe in a string?
Most languages accept the escape \'. Writing the raw character instead works in some contexts and breaks in others, which is what the escape exists to avoid.
Other characters
- ASCII code for left parenthesis — 40
- ASCII code for right parenthesis — 41
- ASCII code for asterisk — 42
- ASCII code for plus sign — 43
- ASCII code for comma — 44
- ASCII code for hyphen — 45
- ASCII code for period — 46
- ASCII code for forward slash — 47
- ASCII code for the digit 0 — 48
- ASCII code for the digit 1 — 49
- ASCII code for the digit 2 — 50
- ASCII code for the digit 3 — 51
Every character by name · The ASCII table · Text to binary converter