'
Single quote
PrintableASCII 39 | Hex 0x27 | U+0027
ASCII 39 serves as the string delimiter in SQL, Python, JavaScript, and Bash. In SQL, forgetting to escape a single quote inside a string (by doubling it as '') is one of the most common sources of injection vulnerabilities. HTML attribute values can use either single or double quotes, but mixing them incorrectly breaks parsing. Typographers distinguish between the straight apostrophe (ASCII 39) and the curly right single quote (Unicode U+2019), though most programming environments treat only ASCII 39 as syntactically valid.
ASCII Code
Decimal
39
Hexadecimal
0x27
Octal
47
Binary
0010 0111
URL Escape
%27
Unicode
Code Point
U+0027
Escape
\u0027
UTF-8 Hex
0x27
UTF-8 Binary
00100111
UTF-16
0x0027
UTF-32
0x00000027
HTML Entities
Numeric
'
Hex
'
Named
'
How to Type
Windows Alt CodeAlt + 39
HTML Entity
'
Unicode InputU+0027
Source Code Representations
C / Java
"\u0027"CSS
\0027JavaScript
"\u0027"Perl
\x{0027}Python 2
u"\u0027"Python 3
\u0027Ruby
\u{0027}Frequently Asked Questions
What is ASCII code 39?
ASCII code 39 represents the Single quote character. In hexadecimal it is 0x27, in binary 0010 0111, and in octal 47. It is a printable character that appears as "'" in text.
How do I type ASCII 39 on a keyboard?
On Windows, hold Alt and type 39 on the numeric keypad. On Mac, you can use the Character Viewer (Edit > Emoji & Symbols). In HTML, use the entity ' or '.