Markdown Section Extractor
Pull a single section out of a Markdown document by its heading — keep or drop nested subsections. Runs entirely in your browser, no server, no sign-up.
What this tool does
Paste a Markdown document, type the heading you want, and get back just that section — the heading and everything beneath it, up to the next heading at the same or a shallower level. Everything runs locally in your browser. Nothing is uploaded, it works offline, and there's no sign-up.
Great for pulling one section out of a long README, splitting documentation, grabbing a single changelog entry, or feeding just the relevant part of a doc to another tool.
How it works
A "section" starts at the matched heading and runs until the next heading of the
same or a higher level (a smaller or equal number of #s). So extracting
## Installation from a doc gives you the Installation heading plus every
### subsection under it, stopping right before the next ##.
| Option | What it does |
|---|---|
| Match mode — exact (default) | Case-insensitive exact match of the trimmed heading text. installation matches ## Installation. |
| Match mode — exact_case | Case-sensitive exact match. |
| Match mode — contains | Matches any heading whose text contains your query (case-insensitive). The first match wins. |
| Include nested subsections (default on) | Keep every deeper ###/#### subsection. Turn it off to get only the body directly under the heading, stopping at the first deeper heading. |
| Include the heading line (default on) | Turn it off to return only the body, without the heading itself. |
Heading styles it understands
- ATX headings —
#,##, … through######, including optional closing hashes (## Notes ##). - Setext headings — a line of text underlined with
===(level 1) or---(level 2). #lines inside fenced code blocks are treated as code, not headings, so a comment like# installin a shell snippet won't be mistaken for a section.
Examples
Given this document:
# My Project
Intro.
## Installation
Run the installer.
### Linux
apt install foo
## Usage
Use it like so.
| Heading | Options | You get |
|---|---|---|
Installation | defaults | The ## Installation heading, "Run the installer.", and the whole ### Linux subsection — stopping before ## Usage. |
Installation | subsections off | Just ## Installation and "Run the installer." |
Usage | heading off | "Use it like so." |
linux | contains | The ### Linux subsection. |
FAQ
Is it free and private?
Yes. Your document never leaves your device, and the tool keeps working offline once the page has loaded.
What if two headings have the same text?
The first matching heading in the document is used.
How do I get only the prose under a heading, without its subsections?
Turn off "Include nested subsections." The section then ends at the first deeper heading, returning only the body directly under your target.
Does it work on a section that runs to the end of the document?
Yes. If there is no following heading at the same or a shallower level, the section continues to the end of the document.
What happens if the heading isn't found?
You get an error that lists the headings the tool did find, so you can check the exact spelling or switch to "contains" matching.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool markdown-section-extractor "# Title
## Installation
Run the installer...
## Usage
..." 'heading=Installation'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/markdown-section-extractor/?markdown=%23%20Title%0A%0A%23%23%20Installation%0A%0ARun%20the%20installer...%0A%0A%23%23%20Usage%0A%0A...&heading=Installation&match_mode=exact&include_subsections=true&include_heading=trueMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
