# “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)

> Canonical HTML version: https://rocketvalidator.com/html-validation/ampersand-did-not-start-a-character-reference-probably-should-have-been-escaped-as-amp
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Unescaped `&` characters in HTML content or attribute values must be written as `&amp;`.

In HTML, the `&` character signals the start of a character reference (like `&amp;`, `&lt;`, or `&#169;`). When the parser encounters a bare `&` that isn't followed by a valid reference, it produces a parse error. Browsers usually recover and display the `&` as intended, but the markup is technically invalid.

This most often appears in URLs with query string parameters (e.g., `?page=1&sort=asc`) or in visible text like "Tom & Jerry". In both cases, every literal `&` must be escaped as `&amp;`.

## HTML examples

### Invalid

```html
<!-- Bare & in an href -->
<a href="search?category=books&sort=title&page=2">Results</a>

<!-- Bare & in visible text -->
<p>Fish & Chips</p>
```

### Valid

```html
<!-- Escaped & in an href -->
<a href="search?category=books&amp;sort=title&amp;page=2">Results</a>

<!-- Escaped & in visible text -->
<p>Fish &amp; Chips</p>
```

The rendered output is identical in both cases. Browsers display `&amp;` as `&` to the user, and links work correctly with `&amp;` in `href` values. The HTML parser converts it back to a literal `&` before making the HTTP request.
