# is-html

> Check if a string is HTML

Latest version **3.2.0** (published 2025-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-html
pnpm add is-html
yarn add is-html
bun add is-html
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2025-09-09 |
| First published | 2013-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 95 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | html, detect, check, is, tags, elements, string |

## Links

- npm: https://www.npmjs.com/package/is-html
- Repository: https://github.com/sindresorhus/is-html
- Homepage: https://github.com/sindresorhus/is-html#readme
- Issues: https://github.com/sindresorhus/is-html/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-html

## Dependencies (1)

- [html-tags](https://npm.io/package/html-tags.md) ^3.1.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2025-09-09
- 3.1.0 — 2024-03-12
- 3.0.0 — 2021-09-01
- 2.0.0 — 2019-05-28
- 1.1.0 — 2017-02-13
- 1.0.0 — 2014-08-14
- 0.2.2 — 2014-04-29
- 0.2.1 — 2014-04-16
- 0.1.1 — 2013-12-13
- 0.1.0 — 2013-12-13

## README

# is-html

> Check if a string is HTML

You should not use this for any kind of validation, sanitation, or XSS checks.

## Install

```sh
npm install is-html
```

## Usage

```js
import isHtml from 'is-html';

isHtml('<p>I am HTML</p>');
//=> true

isHtml('<!doctype><html><body><h1>I ❤ unicorns</h1></body></html>');
//=> true

isHtml('<cake>I am XML</cake>');
//=> false

isHtml('>+++++++>++++++++++>+++>+<<<<-');
//=> false
```

Note: It does not detect deprecated HTML tags.

---
_Source: https://npm.io/package/is-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
