Split a TXT Into Chapters for EPUB: Fix Missing Chapters

Open the converter

Chapters are what make a long book usable on an e-reader. They give you a table of contents and let you jump between parts of the story. A TXT file has no real chapters, only lines that look like headings, so the converter has to spot them. Usually it does. When it doesn’t, the fix takes a few minutes once you know what it’s looking for.

What counts as a chapter heading

The converter checks each line of your file. A line becomes a chapter if it’s 40 characters or shorter, ignoring spaces at each end, and starts with one of the patterns below. Capitalization doesn’t matter.

TypeDetectedNot detected
ChapterChapter 1, CHAPTER 12, Chapter IVChapter One, Chapter1
Ch.Ch. 7, Ch.12Ch 7
PartPart 2, Part IIPart Two
EpisodeEpisode 14Episode Two
Named sectionsPrologue, Epilogue, Interlude, AfterwordForeword, Preface, Introduction
Number alone on a line1. or #12 or [12] or -12-12 with nothing around it
Other labelsNoneBook 1, Volume 2, Side Story 1, Extra 2

A subtitle is fine as long as a space or a separator such as a colon, period or hyphen comes right after the number or name. “Chapter 3: The Road”, “Chapter IV - Home” and “Epilogue: Ten Years Later” are all picked up. Numbers need to be digits or Roman numerals, which is the reason “Chapter One” is missed.

Fan translations often keep their original headings, so the common Japanese, Chinese and Korean forms are recognized too, such as 第1話, 第1章 and 제1화. These work whatever language the book is set to.

When no chapters are found

If the “Chapters” section says “No chapter headings found”, the whole file goes in as a single part. You have two ways to fix it, and which one is quicker depends on how many chapters you have.

For a long book with a consistent heading style, change the headings before you convert. If your book uses “Chapter One”, “Chapter Two” and so on, open it in a text editor and use find and replace to turn them into “Chapter 1”, “Chapter 2”. If every heading is a bare number, a text editor with regular expression search can add a period or the word Chapter to those lines in one go. Then add the corrected file to the converter.

For a handful of chapters, or headings with no pattern at all, mark them by hand.

  1. Press “Add chapter…” at the end of the list in the “Chapters” section, or at the bottom of the “Contents” menu in the preview. This opens the editor. You can also press “Edit” in the top bar.
  2. Use “Part to edit” to go to the part of the book you need.
  3. Click anywhere on the line you want as a heading.
  4. Press “Make this line a chapter title”. A new chapter starts at that line and shows up in the contents.

A blank line can’t be a chapter title, so put the cursor on the line with the words. If you type a heading in the editor that matches a pattern, such as changing “Chapter One” to “Chapter 1”, it’s picked up automatically.

When it splits in the wrong places

The opposite problem is a sentence that happens to look like a heading. Because the check only looks at the start of a short line, lines like these become chapters:

  • “Part I knew he was lying.” Here the word I reads as the Roman numeral one.
  • “Part 2 of the plan was simple.”
  • “Chapter 3 was the worst of them.”
  • A numbered list in the text, where 1. and 2. each sit alone on a line.

To spot these, read down the list in “Chapters”. Real headings tend to look alike, and a stray sentence stands out, particularly one ending in a period. Each entry shows its line number so you can find it.

Turn off the switch on any entry that isn’t a chapter. That line goes back to being an ordinary paragraph inside the chapter before it, and its text doesn’t change. The summary beside the “Chapters” heading changes to something like “41 of 42 chapters on”. You can turn it back on at any time. Inside the editor, “Remove chapter title” does the same job for the line your cursor is on.

Renaming chapters in the table of contents

Each entry in the list has a name you can edit. This changes only what appears in the table of contents, and the heading in the book’s text stays as written. That’s useful for shortening a long heading so it fits on a small screen, or for turning a bare “12.” into something you can recognize.

To change the heading on the page as well, press “Edit” and retype it there. If you haven’t renamed that chapter yourself, its contents entry follows your edit. Once you’ve given it a custom name, it keeps that name. Names can be up to 200 characters and can’t be left empty.

Books made from many files

If you saved a web novel as one file per chapter, you may not need any headings. Add all the files and keep “One book” selected. Each file becomes an entry in the table of contents under its “Section title”, which starts as the file name. Files sort by number, so “Ch 2.txt” comes before “Ch 10.txt”.

Because the file name becomes the entry, “ep_0012_final.txt” will show up just like that. You can rename each one in the “Files” section under “Section title”, though for a long series it’s faster to rename the files before adding them. If those files also contain chapter headings, the contents gets two levels, with the file first and its chapters beneath it.

Text before the first chapter, and books with no chapters

Anything before the first heading, such as a title page or a translator’s note, stays at the front of the book. Nothing is dropped. In a single-file book that opening text gets its own entry at the top of the contents, named after the section title.

Some books don’t need chapters at all. For a short story or a single essay, turn off “Split into chapters automatically” and the file goes in as one continuous part. Your chapter changes aren’t erased, so turning it back on restores them.

Open the converter