HassleFreeTools

Find and Replace

Find text and replace it in one step, with match case, whole word and regular expression options, highlighted matches and a count.

0 lines · 0 characters

Find and replace settings

Used exactly as typed.

Search for

Type what to find.

The result updates as you type. Replace all also changes your text, so you can make another replacement.

Show

0 lines · 0 characters

Runs entirely in your browser. Your files and text are not uploaded.

How to use Find and Replace

  1. Step 1: Add your text

    Type or paste the text, or open a plain-text file.

  2. Step 2: Find and replace

    Type what to find and what to put instead. Matches are counted and highlighted as you type.

  3. Step 3: Copy or keep going

    Copy or download the result, or press Replace all to change your text and make another replacement.

Plain text or regular expression

In plain text mode the tool finds exactly what you type. Characters such as ., * or ( have no special meaning, and the replacement is inserted as typed. Every match is replaced.

In regular expression mode the Find box takes a JavaScript regular expression, for example \d+ for a number or colou?r for both spellings of colour. The flags work as in JavaScript: g replaces every match (turn it off to replace only the first), i ignores case, m makes ^ and $ match at every line, s lets a dot match line breaks, and u turns on Unicode mode. In the replacement, $1, $2 and so on insert the text of a bracketed group, $<name> inserts a named group, $& the whole match and $$ a dollar sign.

Options

  • Match case makes Apple and apple different. It is the same setting as the i flag.
  • Whole words only skips matches inside longer words, so cat does not match category. Letters with accents and Hindi letters count as parts of words; spaces, hyphens, apostrophes and punctuation separate words.
  • Read \n and \t lets you type \n for a line break and \t for a tab. Turn it off to search for a real backslash, as in a Windows path such as C:\new.

A line break is always found as \n, as the text box shows it, even in a file saved with Windows line endings (CRLF). The result gets the file's line endings back, so the download of such a file still uses CRLF.

Worked examples

  • To turn a comma-separated list into one item per line, find , and replace it with \n. "red, green, blue" becomes three lines.
  • To change dates from 16/10/2026 to 2026-10-16, choose regular expression, find (\d{2})/(\d{2})/(\d{4}) and replace with $3-$2-$1.
  • To put "- " at the start of every line, find ^ with the m flag on and replace with - .

The count shows how many matches there are, and Highlighted matches shows your text with each match marked, so you can check a pattern before you use the result.

Slow patterns are stopped

Some regular expressions, such as (a+)+$, take an extremely long time on certain texts because the browser tries a huge number of ways to match. The search therefore runs in a background thread. If it makes no progress for 2 seconds, it is stopped and you see a message instead of a frozen page. A long search that keeps finding matches is not stopped.

Privacy

Everything runs in your browser. Your text is not uploaded or saved.

Limitations

  • One find and replace rule is applied at a time. Use Replace all and then type the next rule to make several changes in a row.
  • Regular expressions use JavaScript syntax, which differs in places from Python, PCRE or Notepad++. For example, named groups are written (?<name>…), not (?P<name>…).
  • With the u flag off, the Whole words only option counts just English letters, digits and the underscore as parts of words.
  • It works on plain text. Formatting from Word or PDF files is not kept, and those files cannot be opened.
  • The highlighted view covers the first 100,000 characters and the first 2,000 matches, and a text of more than 20,000 lines is shown in part; the replacement always covers the whole text.
  • The download keeps the line endings of an opened file, so the tool cannot change Windows line endings (CRLF) into Unix ones (LF).
  • A file that is not saved as UTF-8 or UTF-16 is read as Windows-1252 (Western European), and the tool tells you when that happens.

Frequently asked questions

How do I replace line breaks with commas?

Keep Read \n and \t switched on, type \n in Find and a comma and a space in Replace with. To do the opposite, find a comma and replace it with \n.

How do I use $1 in the replacement?

Choose regular expression and put part of the pattern in brackets. With (\w+)@example.com in Find and $1 in Replace with, “[email protected]” becomes “asha”. In plain-text mode a $ sign is inserted as it is.

Why does my regular expression show an error?

The message under Find explains what is wrong, such as an unclosed bracket. With the u flag on, a backslash may only come before special characters, so patterns written for other programs can need small changes, or you can turn u off.

Why was my search stopped?

It made no progress for 2 seconds, usually because of a pattern with nested repeats such as (a+)+ or (.). Make the pattern more specific, for example by replacing .* with [^,]*.

Can I undo Replace all?

Yes. After Replace all, an Undo button brings back the text as it was. The result box never changes your text by itself.

Is my text sent to a server?

No. The search and the replacement run in your browser, and nothing is uploaded or stored.

Delete repeated lines from a list while keeping the original order, with options to ignore case, extra spaces and empty lines.

Sort lines alphabetically, in natural number order, by number or by length, or reverse and shuffle them, with sorting rules for Hindi and other languages.

Change text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and more. The result updates as you type.

Compare two texts and see what was added, removed or changed, line by line, word by word or character by character.

Count words, characters, sentences and paragraphs as you type, with reading time and keyword density.