How to Export PDF Bookmarks to a Text File

Updated 2026-11-04

Sometimes you need to extract a PDF’s table of contents from the PDF: to back it up before editing, to fix titles in a text editor, to paste it into another document, or to reuse it on a different version of the same file. A reader lets you browse the bookmarks, but getting them out as text is another matter.

The PDF Bookmark Editor exports the whole bookmark tree to a plain .txt file in one click and can import the same format back. Everything happens in your browser; the PDF is not uploaded.

Use the tool: Online PDF Bookmark Editor

Export the bookmarks, step by step

  1. Open the PDF Bookmark Editor and load your PDF - its existing bookmarks appear in the Bookmarks panel on the left (parsed locally, never uploaded)
  2. Click the "Export bookmarks as text" icon (the download arrow) in the toolbar above the list
  3. Your browser saves a file named bookmarks.txt and the editor confirms with "Bookmarks exported as a text file". If the PDF has no bookmarks yet you will see "No bookmarks to export"
  4. Open the file in any text editor

What the exported file looks like

Each bookmark is one line: the title, a tab character, then the page number. Nested bookmarks are indented by two spaces per level, so the hierarchy is easy to read. A top-level bookmark "Chapter 1 Introduction" on page 1 becomes the line Chapter 1 Introduction, a tab, and 1; its child "1.1 Background" on page 2 follows on the next line, indented by two spaces.

The page numbers are physical PDF pages - the number your reader shows in its page box, counting from 1 - not the numbers printed on the pages. The file is saved as UTF-8, so Chinese, Japanese and other non-Latin titles are preserved.

The export reflects what is in the panel right now, including edits you have not saved into the PDF yet.

What you can do with it

Back up the outline before a big edit, so you can always get it back.

Change titles or page numbers in bulk in a text editor, then bring the text back with "Import bookmarks from TOC text": paste it, glance at the "Parse Preview", and choose "Replace All Bookmarks".

Reuse a table of contents on another version of the same document. If the new version has a different number of front pages, enter the difference as the "Page Offset" (Actual PDF Page = TOC Page + Offset; negative numbers are fine).

Because a tab separates the title from the page, pasting the text into Excel or Google Sheets puts them in two columns.

Importing the text back - and one thing to check

In the Bookmarks panel click "Import bookmarks from TOC text", paste the text, and enter a "Page Offset" if page numbers need to move. The "Parse Preview" on the right shows the tree that will be created; "Append to Existing" adds it after the current bookmarks and "Replace All Bookmarks" swaps them out.

The importer decides each line’s level from its numbering first ("1", "1.1", "1.1.1"), then from chapter words such as "Chapter" or the Chinese "第X章", and only then from indentation. For most books these agree with the indentation in the exported file. If a nested entry starts with a number that does not match its depth - for example a "7 Methods" listed under "Part II" - it can come back one level higher than before, so glance at the Parse Preview before you click "Replace All Bookmarks".

Entries whose page would fall outside the document after the offset is applied are skipped, so compare the item count in the preview with what you expect.

FAQ

Does the export include bookmark colors, styles or links to other files?

No. It contains each bookmark’s title, its page number and its level - the information needed to rebuild the outline.

Can I export the bookmarks of a scanned PDF that has none?

There is nothing to export until the PDF has bookmarks. Create them first with "Auto-generate" (scans are read with local OCR) or by pasting a table-of-contents text, then export.

Can I open the file in Excel or Google Sheets?

Yes. The title and the page are separated by a tab, so pasting the text into a spreadsheet puts them in two columns; the indentation stays as leading spaces in the title column.

Is my PDF uploaded when I export?

No. The text file is generated in your browser from the bookmark tree and downloaded directly.

Use the tool: Online PDF Bookmark Editor

More guides

PDFBookmarks on Fazier