Replace Text Between
Replace Text Between Two Characters
Replace Text Between swaps everything between two characters or words that you choose, such as [ and ], for new text. Paste your text, enter where to start, where to end and what to put instead, and copy the result. It is free and runs in your browser.
Replace Text Between Two Characters Tool
Replace Text Between Two Characters Example
Hello how are you [Greg].
Hello how are you Kyle.
Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
What does Replace Text Between do?
This tool replaces the text between two characters or words that you choose with new text. Type where to start, where to end and what to put instead, and every matching piece is swapped, including the start and end characters.
It finds every pair in your text, not just the first. The start and end can be a single character, like [ and ], or longer text, like START and END. If the start and end are the same character, such as a quote, each pair is replaced in turn. A start with no matching end is left as it is.
Use it to fill in placeholders such as [name], swap out tags or comments, mask text in brackets, or clean up templates, subtitles and exports.
Replace text between examples
Each example shows the start, the end and the new text used. Unless an option is named, the start and end are replaced too and line breaks are not matched across.
| Setting | Before | After |
|---|---|---|
| Start [, end ], with Kyle | Hello how are you [Greg]. | Hello how are you Kyle. |
| Placeholder, with Sam | Dear [name], welcome | Dear Sam, welcome |
| Start ( and end ), with X, twice | a (b) c (d) | a X c X |
| Start < and end >, with - | x <b> y | x - y |
| Several letters, START and END, with ... | x START hello END y | x ... y |
| Keep the start and end, with Z | a [b] c | a [Z] c |
| Empty new text, with nothing | a [b] c | a c |
| Across line breaks, off, with Z | [a b] c | [a b] c |
| Across line breaks, on, with Z | [a b] c | Z c |
How to replace text between two characters
- 1Add your text
Type or paste your text into the box, or import a text file. - 2Enter the start, the end and the new text
Type the character or word where the text to replace starts and ends, and the text to put instead. For example [ and ] and Kyle. - 3Click Replace Text
Everything between each start and end is replaced, together with the start and end. Use Undo if you change your mind. - 4Copy it
Click Copy and paste the result where you need it.
When to replace text between characters
Good for
Filling in placeholders in templates, masking or swapping text in brackets, parentheses or tags, and changing a marked part of a text in every place at once.
Check first
The start and end are replaced too, so to keep them tick Keep the start and end characters. Pairs inside pairs are not handled, so in ((a)b) the first end closes the first start. Matching is exact, so capital letters count. The result replaces your text, so use Undo if you need the original.
Other tools
To delete the text between two characters, try Remove Text Between. To replace one word or phrase with another, try Search And Replace. To replace every match in a big text, try Bulk Search and Replace.
Replace text between FAQ
What does the Replace Text Between tool do?
It replaces the text between two characters or words that you enter with the new text you choose, everywhere those two markers appear in your text.
How do I replace text between two characters?
Paste your text, type the start in the Find text starting from box, the end in the Find text ending at box and the new text in the Replace text with box, then click Replace Text. For example, [ and ] with Kyle turns [Greg] into Kyle.
Can the start and end be longer than one character?
Yes. They can be words or any text, such as START and END or the tag pair that opens and closes a block.
Are the start and end characters replaced too?
Yes, by default, so [Greg] becomes Kyle. Tick Keep the start and end characters to get [Kyle] instead.
Does it replace every pair or only the first?
Every pair. The tool goes through the whole text and replaces each piece of text between a start and the next end.
Can I leave the new text empty?
Yes. The text between the start and end is then deleted. For that job you can also use Remove Text Between.
What happens if a start has no end?
It is left as it is, along with the text after it, because there is nowhere to stop.
Does it work across line breaks?
Not by default, so a stray start character cannot replace a whole page. Tick Also match across line breaks to replace text that runs over several lines.
What if nothing is found?
The tool shows a message and leaves your text as it is.
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 Replace ToolsLast updated: 15 November 2026
