Ampersand (&) is Unicode U+0026 — the familiar “and” sign. In HTML it is reserved: a bare & starts a character reference, so you almost always write it as an entity when you want a literal ampersand on the page.
Remember
Character &
Unicode U+0026
Hex entity &
Decimal &
Named entity &
CSS escape \0026
Rule Escape & in text and attributes
Prefer the named form & in hand-written HTML — it is short, standard, and required for valid XML/XHTML as well. Use numeric forms or CSS escapes when generating markup or stylesheet content.
Reference
Quick Reference
One table for every form you will actually use.
Form
Code
Where it goes
Named entity
&
HTML text & attributes (preferred)
Hex entity
&
HTML markup
Decimal entity
&
HTML markup
CSS escape
\0026
Stylesheet content
Bare &
—
Avoid in markup — escape instead
When to Use Which
Situation
Use
Normal text (“Ben & Jerry”)
&
Query strings in href / src
?a=1&b=2
Generated / ASCII-only markup
& or &
CSS ::before / ::after
content: "\0026"
Starting another entity (é)
Leave that & as part of the entity name
See it
Live Preview
Ampersand rendered safely from character references.
Inline textSalt & pepper
Large glyph&
Brand-styleAT&T · R&D
Monospacea=1&b=2
All formsNamed: & | Hex: & | Decimal: &
Code
Complete HTML Example
One page that shows ampersand with hex, decimal, named entity, CSS escape, and a real-world phrase. Use View Output or open the live editor.
Hex + Decimal + Named + CSS + Phrase
Five safe ways to produce & without a bare ampersand in markup.
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ampersand (&) in HTML</title>
<style>
#point::after {
content: "\0026";
}
</style>
</head>
<body>
<p>Ampersand using Hex Code: &</p>
<p>Ampersand using HTML Code: &</p>
<p>Ampersand using Named Entity: &</p>
<p id="point">Ampersand using CSS Entity: </p>
<p>In a phrase: Rock & Roll</p>
</body>
</html>
Ampersand (U+0026) and its entity forms (&, &, &, CSS \\0026) are supported in all mainstream browsers.
✓ Universal support
Ampersand (&)
Encode with named, hex, decimal, or CSS escape — same glyph everywhere. Prefer & in markup.
100%Browser coverage
Google ChromeSupported
Yes
Microsoft EdgeSupported
Yes
Mozilla FirefoxSupported
Yes
Apple SafariSupported
Yes
OperaSupported
Yes
Internet ExplorerAll versions
Yes
U+0026 / entitiesFull support
Bottom line: Prefer & in HTML text and attributes. Use & / & when generating markup, and \\0026 only inside CSS content.
Remember
Key Takeaways
Unicode: ampersand is U+0026 (decimal 38).
HTML: prefer & (or & / &).
CSS: use \0026 inside content for generated text.
Rule: escape every literal & in text and attributes.
One line:U+0026 → & / & / & / CSS \0026.
Frequently Asked Questions
Use & (named), & (decimal), & (hex), or the CSS escape \0026 in content. Prefer & in everyday HTML text and attributes.
U+0026 (hex 0026, decimal 38). It belongs to the Basic Latin (ASCII) block.
In HTML, & starts a character reference. An unescaped & can confuse parsers or break attributes. Escaping with & always shows a literal ampersand safely.
In HTML attributes, query-string separators should be written as & — for example href="/search?q=a&page=2". Browsers still resolve the correct URL.
HTML entities (&, &, or &) go in markup. The CSS escape \0026 is used in stylesheets (usually in content on ::before/::after). Both render &.
HTML5 is forgiving in some cases, but bare & is still a common source of bugs. Always use & (or a numeric form) for a literal ampersand in text and attributes.
🤔
Did you know?
Ampersand is Unicode U+0026 (decimal 38). It is a reserved HTML character — always prefer & (or & / &) in text and attributes so the browser does not treat & as the start of another entity.