GitHub Repo to Markdown (Codebase to Text)
Turn a GitHub repo into one markdown file for LLM context. Directory tree, file contents and token count, like repomix or gitingest, in the browser.
Public repositories only. Binary files, node_modules, dist, build and lock files are skipped unless an include glob names them. Token estimate is characters ÷ 4.
What Is Repomix and a Repo to Markdown Tool?
Repomix is a packer that turns a whole code repository into a single text file that a large language model can read in one prompt; this page is a browser-based repo to text converter that does the same job for any public GitHub repository. The output is one markdown document: a header with the source and size, an ASCII directory tree, then a section per file with the contents in a fenced code block tagged with the language.
Tools such as gitingest and repomix produce the same shape from the command line; here you paste a URL instead of installing a package. The server fetches the files from GitHub because browsers cannot call the API across origins without a proxy; nothing is stored.
How to Convert a GitHub Repo to Markdown
- Paste the repository URL (https://github.com/owner/repo, a /tree/branch/folder URL, or owner/repo).
- Optionally set a branch, include globs such as
src/**, *.mdand exclude globs such as**/*.test.ts. - Adjust the per-file and total size caps if the default 100 KB / 5 MB is too tight or too loose.
- Click Generate markdown and wait for the tree and files to load.
- Check the file count, size and estimated token count against your model's context window.
- Copy the markdown into your prompt or download it as a .md file.
Output Format and Options
| Option | Default | Effect |
|---|---|---|
| Branch | repository default | Any branch or tag name; /tree/ URLs set it automatically |
| Include globs | all text files | src/**, *.py, docs; overrides the default excludes |
| Exclude globs | vendor and build folders, locks, binaries | Added to the defaults, e.g. **/__tests__/** |
| Max file KB | 100 | Larger files are skipped and counted under Skipped |
| Max total MB | 5 | Fetching stops at the cap and the output is marked truncated |
| Token estimate | characters ÷ 4 | Rough size for GPT-4o, Claude and Gemini context windows |
Codebase to Markdown for LLM Context
A codebase to markdown dump works best when it is selective. Models answer more accurately with the twenty files that matter than with two thousand that do not, so start with the directory tree (generate once with an include glob like *.md to see the structure cheaply), then include the folders you want the model to reason about. Keep the total under roughly 100,000 tokens for most chat interfaces, and put your question after the code in the prompt.
Repomix, Gitingest and the README to PDF Shortcut
If you already use repomix or gitingest locally, this tool gives the same markdown from a link, which is handy on a machine without Node or Python. The github readme to pdf button covers a different need: a printable copy of a project's README for documentation packs or offline reading. It fetches only README.md, sends it through the markdown to PDF converter and downloads the result; the repository contents are not needed for that step.
Frequently Asked Questions
What is repomix and how is this different?
Repomix is a command-line tool that packs a repository into one AI-friendly file. This page does the same for public GitHub repositories without installing anything: paste the URL, get a markdown document with the directory tree and every text file, ready to paste into ChatGPT, Claude or Gemini.
How is the token count estimated?
It divides the character count by four, which is close to the average for English text and source code with GPT and Claude tokenizers. Treat it as a guide; the model's own counter is authoritative. Use include globs to keep the output under your model's context window.
Does it work with private repositories?
No. The server calls the public GitHub API without your credentials, so only public repositories are readable. For private code, run repomix or gitingest locally and paste the result into the markdown editor.
Why did I get a rate limit error?
GitHub allows 60 unauthenticated API requests per hour per address, and each generation uses two of them plus raw file downloads. If many people use the tool at once the limit can be hit; wait a few minutes or narrow the include globs so fewer files are fetched.
How do I turn a GitHub README into a PDF?
Click README to PDF. The tool fetches only README.md from the repository root and sends it to the markdown to PDF converter, which returns the file. This github readme to pdf shortcut uses the same free daily pool as the other PDF exports.
Which files are skipped?
Binary files (images, fonts, archives, compiled code), .git, node_modules, dist, build, coverage and vendor folders, lock files, minified bundles and source maps. Files larger than the per-file limit (100 KB by default) are skipped too. An include glob such as dist/** overrides the defaults.