# EPUBCheck HTM-004: Irregular DOCTYPE: found …, expected …

Source: https://epublab.com/epubcheck/htm-004/ (updated 2026-11-03)

EPUBCheck HTM-004 is an error message: “Irregular DOCTYPE: found "…", expected "…".” A document has a DOCTYPE other than the one expected for its EPUB version; EPUBCheck shows both.

- Official message (EPUBCheck 5.4.0): Irregular DOCTYPE: found "%1$s", expected "%2$s".
- Default severity: Error

## Typical causes

- An XHTML 1.1 DOCTYPE left from an EPUB 2 book in an EPUB 3 file.

## How to fix it

- For EPUB 3 XHTML, use <!DOCTYPE html>.

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EPUBLab.
