# EPUBCheck NCX-004: whitespace in NCX uid, how to fix it

Source: https://epubcc.com/epubcheck/ncx-004/ (updated 2026-11-04)

EPUBCheck NCX-004 is a usage message: “NCX identifier ("dtb:uid" metadata) should not contain leading or trailing whitespace.” The NCX's dtb:uid value has spaces or line breaks before or after it. The identifier should match the package's unique identifier exactly, and extra whitespace can make a strict comparison fail.

- Official message (EPUBCheck 5.4.0): NCX identifier ("dtb:uid" metadata) should not contain leading or trailing whitespace.
- Default severity: Usage

## Typical causes

- Pretty-printed XML that put the value on its own line.
- A value pasted with a trailing space.

## How to fix it

1. Open the NCX (usually toc.ncx) and find <meta name="dtb:uid" content="..."/>.
2. Remove the whitespace around the value of the content attribute so it is identical to the package's dc:identifier.
3. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

## When it's not this

If the value is different from the package identifier, not just padded, the error is NCX-001.

## Sources

- EPUB 3.3, §5.9.5 NCX: https://www.w3.org/TR/epub-33/#sec-opf2-ncx (read 2026-11-04)

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