'
Punctuation

Apostrophe '

The apostrophe (or straight single quote) is used in contractions, possessives, and as an attribute delimiter in HTML. While ' originated in XML and was not part of HTML 4, it is fully supported in HTML5. For typographic quality, the curly apostrophe ’ is preferred in body text.

All Representations

Named Entity
'
Decimal Code
'
Hex Code
'
Unicode
U+0027

Rendered Output

'

' renders as the character shown above

When to Use Apostrophe

Use the apostrophe entity inside single-quoted HTML attribute values and when you need to prevent ambiguity in template strings or JavaScript embedded in HTML. For natural-language text, the right single quotation mark ’ is the typographically correct choice for apostrophes and contractions.

Try It — HTML Examples

Named entity in text
<p>Symbol: &apos;</p>
Decimal reference
<p>Symbol: &#39;</p>
Hex reference
<p>Symbol: &#x27;</p>
Inside an HTML attribute
<div title="The Apostrophe: &apos;">Hover to see</div>

About the Apostrophe Entity

The Apostrophe character (') is a standard HTML entity defined in the HTML specification. In HTML source code, it can be written using the named entity reference &apos;, the decimal numeric character reference &#39;, or the hexadecimal numeric reference &#x27;. The character is assigned Unicode code point U+0027 in the Universal Character Set.

The apostrophe (or straight single quote) is used in contractions, possessives, and as an attribute delimiter in HTML. While &apos; originated in XML and was not part of HTML 4, it is fully supported in HTML5. For typographic quality, the curly apostrophe &rsquo; is preferred in body text.

Punctuation and whitespace entities are among the most frequently used HTML entities in web development. They handle characters that either have special meaning in HTML syntax — such as angle brackets and ampersands — or represent typographic characters that improve the visual quality of text, like em dashes and curly quotes. Proper use of punctuation entities is essential for producing valid, well-formed HTML documents and achieving professional-looking typography on the web.

When deciding how to encode the Apostrophe character in your HTML documents, the named entity &apos; is generally the most readable choice for developers reviewing or maintaining source code. The decimal form &#39; and hexadecimal form &#x27; are equally valid alternatives that work in contexts where named entities may not be supported, or when generating HTML output programmatically from server-side code. All three representations produce identical visual output in every modern web browser.

Use the apostrophe entity inside single-quoted HTML attribute values and when you need to prevent ambiguity in template strings or JavaScript embedded in HTML. For natural-language text, the right single quotation mark &rsquo; is the typographically correct choice for apostrophes and contractions.

Related Entities

Explore More HTML Entities

Browse our complete reference of 262 HTML entities with codes, examples, and usage tips.