# End tag “br”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/end-tag-br
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

In HTML, certain elements are classified as **void elements** — they cannot contain any content and must not have a closing (end) tag. The `<br>` element, which represents a line break, is one of these void elements. Others include `<img>`, `<input>`, `<hr>`, `<meta>`, and `<link>`.

When the validator encounters `</br>`, it interprets it as a closing tag for a `<br>` element. Since void elements are forbidden from having closing tags by the HTML specification, this produces the error "End tag `br`."

## Why this matters

- **Standards compliance:** The [WHATWG HTML Living Standard](https://html.spec.whatwg.org/multipage/syntax.html#void-elements) explicitly states that void elements must not have an end tag. Using `</br>` violates this rule.
- **Browser inconsistency:** While most browsers will silently recover from `</br>` — some treat it as a `<br>`, others may ignore it entirely — relying on error recovery behavior is unpredictable and can lead to inconsistent rendering across browsers.
- **Code clarity:** Using `</br>` suggests the element has an opening and closing pair, which is misleading to other developers reading the code. It implies a misunderstanding of how the element works.

## How to fix it

Replace every instance of `</br>` with `<br>`. That's it. There's no need for a closing tag because `<br>` is self-closing by definition.

Both `<br>` and `<br/>` (with a trailing slash) are valid in HTML5. The `<br>` form is generally preferred in HTML documents, while `<br/>` is required in XHTML and sometimes used for compatibility with XML-based tools.

## Examples

### ❌ Invalid: using an end tag for `<br>`

```html
<p>First line</br>Second line</p>
```

This triggers the "End tag `br`" validation error.

### ❌ Also invalid: pairing an opening and closing `<br>` tag

```html
<p>First line<br></br>Second line</p>
```

Even when paired with an opening `<br>`, the `</br>` end tag is still invalid.

### ✅ Valid: using `<br>` without a closing tag

```html
<p>First line<br>Second line</p>
```

### ✅ Also valid: self-closing syntax with a trailing slash

```html
<p>First line<br/>Second line</p>
```

This form is acceptable in HTML5, though `<br>` without the slash is more conventional in modern HTML.

### ✅ Practical example: an address block

```html
<address>
  123 Main Street<br>
  Suite 400<br>
  Springfield, IL 62704
</address>
```

## Other void elements

The same rule applies to all void elements. None of these should have closing tags:

`<area>`, `<base>`, `<br>`, `<col>`, `<embed>`, `<hr>`, `<img>`, `<input>`, `<link>`, `<meta>`, `<source>`, `<track>`, `<wbr>`

If you see a similar "End tag" error for any of these elements, the fix is the same: remove the closing tag.
