# How to remove HTML tags from text in Google Sheets

Replace every tag with a space using REGEXREPLACE, then tidy up: =TRIM(SUBSTITUTE(REGEXREPLACE(A2,"<[^>]+>"," "),"&amp;","&")).

**Google Sheets:** `=TRIM(SUBSTITUTE(REGEXREPLACE(A2,"<[^>]+>"," "),"&amp;","&"))`

**Excel:** Excel 365 has REGEXREPLACE, and the same formula works there. In older versions, use Find and Replace with <*> in Find and nothing in Replace (the * is a wildcard).

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Description (HTML) | Plain text |
| `<p>Oak desk, <b>140 cm</b></p>` |  |
| `<p>Ships in <i>2 days</i></p>` |  |
| No tags here |  |
| `<ul><li>Steel</li><li>Black</li></ul>` |  |
| `<a href="/lamps">Desk lamp</a> &amp; bulb` |  |

Formula in B2, filled to B6: `=TRIM(SUBSTITUTE(REGEXREPLACE(A2,"<[^>]+>"," "),"&amp;","&"))`

Result: Oak desk, 140 cm; Ships in 2 days; No tags here; Steel Black; Desk lamp & bulb

## How it works

The pattern `]+>` matches a <, then anything that isn't a >, then the >: one whole tag. Replacing each tag with a space, rather than nothing, keeps words from list items apart ("Steel Black", not "SteelBlack"). SUBSTITUTE turns the &amp; entity back into &, and TRIM removes the extra spaces.

## Other ways

- `=REGEXREPLACE(A2,"<[^>]+>","")`: Deletes the tags without adding spaces or decoding entities. ("SteelBlack", and the "&" entity stays as it is.)

## Common mistakes

- Other entities, like &nbsp; and &quot;, need their own SUBSTITUTE.
- Text inside <script> or <style> blocks isn't a tag and stays in the result.

## Questions

**How do I keep line breaks from <br> tags?**

Replace them first: `=REGEXREPLACE(A2,"",CHAR(10))`, then strip the rest.

**How do I extract a link's address?**

Capture the href: `=REGEXEXTRACT(A2,"href=""([^""]+)""")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/remove-html-tags-in-google-sheets
