How can I import a PDF or Word document?

Importing an existing document to GitBook is easy. Upload it when creating a book using the Import tab.

Accepted formats currently supports importing:



Microsoft Word Document

.doc or .docx

DocBook v5.x


HTML file


For better results, we recommend using:

  • Microsoft Word 2007+ documents

  • DocBook v5.x documents

For DocBook v4 documents, please consider converting them to version 5 for improved compatibility.


This conversion generates a set of markdown files from the original document, along with a suitable

For example, a document with this structure...

[Content here becomes the book's]
* Section 1
[Content here becomes the a chapter's]
* Section 1.1
* Section 1.1.1
* Section 1.1.2
* Section 1.2
* Section 2
[Content here becomes the content of chapter 2]

... will be converted to a book with this structure:

β”œβ”€β”€ section-1
β”‚ β”œβ”€β”€
β”‚ β”œβ”€β”€
β”‚ └──

Also, for .docx documents, all included images are exported to an assets/ folder.

Command line

The import feature uses the gitbook-convert CLI utility. If you ever need more flexibility, consider using gitbook-convert locally, create a repository and import it using Git or GitHub.

​gitbook-convert infers a book structure from your document's structure, based on header levels. Top-level headers become chapters. Chapters are folders with a as preface, and sub-chapters for every second-level headers. If no second-level headers are present, the chapter will consist of a single file instead of a folder.