Paste text and get every substring that sits between a start and an end marker: parentheses, square or curly brackets, quotes, HTML tags, or any words or symbols you type. Matches are highlighted in your text, counted, and ready to copy as a list or CSV.
Last updated:
0matches
0unique
0lines with matches
Matches in your text
Frequency
Value
Count
Share
Advertisement
Advertisement
How to use the Extract Text Between Delimiters
Paste your text or open a text file. An example is loaded to show how it works.
Choose the delimiters: pick a preset such as parentheses, quotes or an HTML tag, or type your own start and end markers.
Adjust the matching: include the delimiters, match nested brackets, ignore case, or keep matches on one line.
Clean the list: trim spaces, drop empty and duplicate values, and sort.
Copy or download the extracted values, or use the frequency table to count how often each one appears.
How matching works
The tool scans your text from left to right. Each time it finds the start marker, it takes the text up to the next end marker, records it as one match, and continues searching after that end marker. Matches never overlap, and every occurrence is found, not only the first one.
Nested brackets. With different start and end markers, such as ( and ), the tool can count depth so (express (overnight)) returns express (overnight). Without nesting, the first closing marker ends the match and you get express (overnight.
Same start and end. Quotes and backticks open and close with the same character, so they cannot nest: the 1st and 2nd quote form a pair, then the 3rd and 4th, and so on. An odd number of quotes leaves the last one unmatched.
Escaped delimiters. In code and JSON, \" means a literal quote. With escapes skipped, "Lee \"Chef\" Park" returns Lee \"Chef\" Park as one value.
Blank marker. A blank start means "from the beginning of the line", a blank end means "to the end of the line". This turns the tool into a "text before X" or "text after X" extractor.
Examples
Goal
Start
End
Input
Result
Text in parentheses
(
)
Paris (France), Rome (Italy)
France, Italy
Template variables
{{
}}
Hi {{name}}, your code is {{code}}
name, code
Quoted phrases
"
"
She said "yes" and "thanks"
yes, thanks
Log levels
[
]
[INFO] started [WARN] slow
INFO, WARN
Value after a label
Total:
(blank)
Total: $42.10
$42.10
Text before a separator
(blank)
-
Main Street - Building 4
Main Street
Table cells
tag td
<td class="x">12</td><td>15</td>
12, 15
Tips
Markers are matched literally, so characters such as ., * or ? need no escaping. For patterns (for example "any digit"), use the regex tester instead.
Turn off Allow matches across lines when processing logs or CSV rows, so a missing closing marker on one line does not swallow the following lines.
Tick Include delimiters when you want to delete or replace the found pieces later with find and replace.
Use Remove duplicates and Sort A–Z to turn a long document into a clean list of distinct values, or read the frequency table to see which value appears most.
Frequently asked questions
How do I extract text between two strings?
Choose Custom in the Delimiters list and type the start string and the end string, for example ID: and a semicolon. The tool finds each start marker, takes everything up to the next end marker after it, and lists each piece. Markers can be single characters, words or longer strings, and every occurrence in the text is extracted, not just the first.
What happens with nested brackets like (a (b) c)?
With Match nested brackets on (the default), the tool counts opening and closing markers, so the outermost pair is matched and (a (b) c) gives "a (b) c". Turn it off to stop at the nearest closing marker instead, which gives "a (b". Nesting only applies when the start and end markers are different, and in tag mode it pairs nested tags of the same name, such as a div inside a div.
Can I extract text between HTML tags?
Yes. Choose the HTML/XML tag preset and type the tag name, such as td, h2 or a. Opening tags with attributes, like <a href="…" class="x">, are matched, the text up to the matching closing tag is extracted, and you can tick Strip inner tags to get plain text. For complex, badly formed HTML, a real parser is more reliable than pattern matching.
How do I get the text before or after a word on each line?
Leave one marker blank. With the start blank, each match runs from the beginning of the line to the end marker; with the end blank, it runs from the start marker to the end of the line. For example start "Total:" with a blank end extracts everything after Total: on every line.
Does it handle escaped quotes?
With Skip escaped delimiters on, a delimiter preceded by a backslash, such as \" inside a JSON string, is treated as part of the text rather than the end of the match. Doubled quotes used in CSV files ("") are not treated as escapes.
Can I count how many times each value appears?
Yes. The frequency table under the results lists every distinct value with its count and its share of all matches, sorted from most to least common, and it has its own Download counts CSV button. The match count and the number of unique values are also shown at the top of the results.
Is my text uploaded anywhere?
No. The extraction runs entirely in your browser with JavaScript. Nothing you paste or open is sent to a server, so it is safe for logs, code and private documents.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.