Convert a GitHub Repository to Text

Combine selected source files into one formatted text file

Try the new version of repo2txt

Paste a repository URL, or a URL for a branch, tag, or directory.

Convert From Local Directory Instead

Turn repository files into useful text context

repo2txt Classic reads a GitHub repository, displays its directory tree, and lets you choose the files and extensions to include. It combines the selected source into a single structured text output that is easier to paste into an LLM prompt, search, review, or save for later.

How to convert a GitHub repository

  1. Paste the full GitHub repository URL. Branch, tag, and directory URLs are accepted.
  2. Add a personal access token only if the repository is private or you need a higher GitHub API rate limit.
  3. Fetch the directory structure, then select the files, folders, and extensions you want.
  4. Generate the text to copy or download, or download the selected files as a ZIP archive.

Designed for focused code exports

  • Browse the complete repository tree before generating output.
  • Exclude folders or file types that are not relevant to your task.
  • Estimate the output token count before copying it into an AI tool.
  • Use the local folder to text converter when the code is not on GitHub.

Browser-based processing and GitHub access

The converter is a static browser app. Repository requests go directly from your browser to the GitHub API, and selected file contents are assembled locally in the page. If you enter a personal access token, repo2txt stores it in your browser's local storage for convenience; you can remove it by clearing the field and submitting the form.