What Is the Difference Between Index and Table of Contents?

A table of contents lists chapter and section titles of a piece, and an index lists different topics discussed within the piece. If searching the book or paper by topic, an index is more helpful than a table of contents.