What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To display the literal text & in an HTML page, write & in the HTML source. The browser interprets the first & as a character reference, so the page shows &.
What to write in your HTML
Use the following source when you want the rendered page to show the entity spelling rather than just an ampersand:
<p>Write &amp; to show the text &amp;.</p>
Visible result:
Write & to show the text &.
The examples above are shown as code here, so their ampersands are escaped for this article. In your own HTML file, the source line should contain & at each place where you want the page to display &.
Why the extra escaping works
In HTML, an ampersand begins a character reference. The named reference & represents the ampersand character, so writing it directly in HTML displays only &. To show the characters &, escape that leading ampersand as & in the source; the browser displays the first ampersand and treats the remaining letters and semicolon as text.
#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
| HTML source | Rendered text |
|---|---|
& |
& |
&amp; |
& |
&amp; |
& |
&amp; |
& |
Can you use a numeric character reference?
Yes. HTML supports decimal and hexadecimal numeric character references as well as named references. The ampersand is Unicode U+00026, decimal 38 and hexadecimal 26, so & or & can supply the initial ampersand. For example, &amp; renders as &. For this simple case, & is usually easier to recognize and read.
Does putting it in code or pre tags change the rule?
No. <code> and <pre> affect presentation; they do not turn off HTML parsing. If you are showing HTML source inside a page, escape its ampersand in the surrounding HTML as needed. For example, to display the source spelling &, the page’s HTML source must contain &amp;.
Rank #2
What about XHTML or XML?
This answer describes HTML syntax. The WHATWG HTML Standard treats HTML and XML as distinct syntaxes; a document served as XHTML/XML follows XML parsing rules, so do not assume every HTML parsing detail applies unchanged. Consult the rules for the actual syntax and serialization you are using.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why the forum workaround may not apply
The original SitePoint question concerned output on a website. Some replies proposed splitting the text with markup for the forum’s own post renderer, but that is specific to how a forum displays posts. For ordinary HTML page text, escaping the leading ampersand as shown above is the direct solution.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
Best Value
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

