Toolman

ASCII code for apostrophe

39

Apostrophe — '

Decimal39
Hexadecimal0x27
Octal0047
Binary00100111
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

Every character by name · The ASCII table · Text to binary converter