Do table of contents, appendices, and chapter titles count toward the total word count for a book?
For example, if a book is 50,000 words, what is not included in the count? This is for a nonfiction book.
After about fifteen minutes research, I couldn't find an authoritative answer for this. I suspect there's a good reason for this, however: At counts in the tens of thousands, the answer doesn't make much difference.
For example, you have a 50,000 word book (by raw body text count). Let's say the work has 100 headings, averaging 6 words each. Even duplicating these in the table of contents, this would only increase the word count by 1,200. That's just 2.4%, a fairly negligible difference. Any publisher or reviewer who is that worried about word count will probably spell all this stuff out for you.
However, my simple gut answer would be: Include everything but the table of contents. Chapter headings, appendices, and even citations all represent "writing effort" by the author. If you're paid by the word, then you should be paid for this effort. Similarly, all these add to the length of the book for layout/formatting purposes. Again, including them seems like the most accurate approach.
I just looked through my non-fiction book contract from an academic publisher, and it says "approximately 70,000 words in length" and then says in parentheses that this would make for a 280 page book. The only other relevant detail was that the publisher would handle the index (they did the table of contents as well), which means that AncientToaster's answer was pretty much on the mark for my experience. There would have been penalties if the book had ended up being much longer or shorter, I think, but this wasn't mentioned. (It ended up being just 250 pages long, when published.)