Extract Text Between
Extract Text Between Two Characters
Extract Text Between finds the text that sits between a start and an end character or word and lists each match on its own line. Paste your text, enter the start and end, and copy the result. It is free and runs in your browser.
Extract Text Between Two Characters Tool
Extract Text Between Example
Start: [ End: ]
There's an art to getting your way, and [spitting olive pits across] the table isn't it.
spitting olive pits across
Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
What does Extract Text Between do?
This tool finds the text between a start and an end that you choose and puts each match on its own line. Everything else is removed from the result.
The start and end can be single characters, such as [ and ], or whole words and tags. It works line by line, finds every match on a line from left to right, and skips empty matches. The match is case sensitive.
Use it to pull out the words inside brackets, quotes or tags, the values between two labels, or the parts of a log line that sit between two markers. Tick Include the start and end text to keep the markers, or Remove duplicate matches to list each match once.
Extract text between examples
Each example shows the text before and after extracting, with the start and end text used. Both options are off unless the example says otherwise.
| Case | Before | After |
|---|---|---|
Square brackets[ to ] | There's an art to getting your way, and [spitting olive pits across] the table isn't it. | spitting olive pits across |
Several matches on a line[ to ] | Items: [apple], [pear] and [plum] | apple pear plum |
Several lines( to ) | Name: (Ann) No match here Name: (Bob) | Ann Bob |
Words or tags as markers<b> to </b> | <b>Hello</b> and <b>World</b> | Hello World |
Same start and end" to " | He said "yes" and "no" | yes no |
Markers included (option on)[ to ] | a [b] c | [b] |
Duplicates removed (option on)[ to ] | [x] [y] [x] | x y |
How to extract text between two characters
- 1Add your text
Paste your text into the box, or import a text file. - 2Enter the start and end
Type the start text in Extract text starting from and the end text in Extract text ending at. - 3Click Extract Text Between
Every match is found and put on its own line. Use Undo if you change your mind. - 4Copy it
Click Copy and paste the list where you need it.
When to extract text between
Good for
Pulling out the words inside brackets, quotes or tags, the values between two labels, and the parts of log lines, templates and lists that sit between two markers.
Check first
The start and end must be on the same line, and the match is case sensitive. Matches are not nested, so in [a [b] c] the match is a [b. The result replaces your text, so use Undo if you need the original.
Other tools
To delete the text between two characters instead try Remove Text Between. To change it try Replace Text Between.
Extract text between FAQ
What does the Extract Text Between tool do?
It finds the text that sits between a start text and an end text that you choose, and puts each match on its own line. Everything else is removed from the result.
How do I extract text between two characters?
Paste your text, type the start text in Extract text starting from and the end text in Extract text ending at, then click Extract Text Between. For example, with [ and ] the text a [b] c gives b. Click Copy to use the result, or Undo to go back.
Can I use words instead of single characters?
Yes. The start and end can be any text, such as a word, a tag like <b> and </b>, or several characters. The match is case sensitive, so Start and start are different.
What if there are several matches on one line?
Each match is returned on its own line, from left to right. In Items: [apple], [pear] you get apple and pear.
Does it work line by line?
Yes. The start and end text must be on the same line. A match is never taken across a line break, and a line without a match adds nothing to the result.
Can I keep the start and end text in the result?
Yes. Tick Include the start and end text and each match is returned with them, so [b] stays [b].
Can the start and end text be the same?
Yes. With a quote mark as both, the text He said "yes" and "no" gives yes and no, because each pair of quotes is one match.
Does it remove duplicate matches?
Not by default. Tick Remove duplicate matches to list each match only once. An empty match, such as [] with nothing inside, is always skipped.
What if nothing is found?
The text is left as it is and you see the message No text found between the start and end text.
Is this tool free and is my text private?
Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.
Looking for more text tools?
Browse Extract ToolsLast updated: 9 November 2026
