Everyday · TextRuns locally

Text Cleaner

Clean copied text without changing the original input. Choose the operations you need, preview the result, then copy or download it.

New to text cleaning? Read the step-by-step guide

Local text workbench

Clean a copy of your text

Operations run in the documented order. The original stays in the input until you explicitly replace or clear it.

Up to 500,000 characters

The input is kept separate from the result.

0 characters

Read-only preview. Copies and downloads retain the selected line-ending style even when the browser displays every line break alike.

0 characters

Text boundaries

NFKC can change compatibility characters.

Spaces and lines

Literal find and replace

Literal text only. Regular expressions are not supported. Up to 10,000 characters.

Order and joining

Cleaning pipeline order
  1. Line endings
  2. Unicode normalisation
  3. Literal replacement
  4. Whole-text trim
  5. Line trim
  6. Whitespace collapse
  7. Empty-line removal
  8. Duplicate removal
  9. Line order
  10. Join lines
Enter text to see a cleaned preview.

Result summary

Counts describe the mechanical difference, not whether a change is correct.

Input characters
0
Output characters
0
Input lines
0
Output lines
0
Character difference
0
Lines removed
0
Duplicates removed
0

Operations applied

  • Waiting for text.
Step-by-step guide

Clean one copied list—and know what each change costs

Follow the included fruit list from messy input to reviewed output. Start with the defaults, add stronger operations one at a time, and learn the technical terms only when they help you make the next decision.

Back to the Text Cleaner
Beginner guide contents
Start with the problem

Text cleaning in one minute

You copied a list. It now has spaces around some items, a gap in the middle, and the same fruit twice. Before deciding what to delete, look at what Foxger’s current defaults do.

Before

  Apples  
Green   pears

Apples
  Mangoes  

The first and last items have outside spaces. “Green pears” has three internal spaces.

After — current defaults

Apples
Green   pears

Apples
Mangoes

The outside and line-edge spaces are gone. The internal spaces, blank line, and repeated item remain.

Text Cleaner applies mechanical formatting or line rules to a separate result. It does not overwrite the input while you review the preview. You choose which additional operations run.

Some changes mainly adjust formatting. Others remove, reorder, join, or replace content. Foxger can show what changed, but it cannot decide whether that change preserves your meaning.

Choose the right task

Do you need Text Cleaner?

Use it when you can name a precise formatting, line, or literal-text change.

It may help with

  • a list copied from a spreadsheet;
  • accidental spaces, tabs, or blank lines;
  • exact duplicate lines;
  • sorting or reversing independent items;
  • turning one item per line into comma-separated text;
  • simple literal replacements.

Choose another approach for

  • grammar, tone, or semantic rewriting;
  • finding differently worded lines with the same meaning;
  • regular-expression transformations;
  • spreadsheet-aware or structured CSV cleaning;
  • repairing a formatted document;
  • deciding whether repeated information is intentional.
Make the first pass understandable

Start with conservative cleanup

Begin with Trim beginning and end and Trim each line, which are selected by default. They produce the first After example without deleting any fruit line.

In this list, the three spaces inside “Green pears” and the empty gap are also accidental. Enable Collapse repeated spaces and tabs and Remove empty linesonly after making that judgment. The preview becomes:

Apples
Green pears
Apples
Mangoes

Both “Apples” lines are still present. That is useful: formatting has been cleaned, but no repeated content has disappeared yet.

Use practical judgment

Lower-risk and stronger changes

No operation is safe in every kind of text. The useful distinction is whether you can explain the intended change and recognise a wrong result.

Usually lower-risk when intentional

  • trimming accidental whitespace outside the complete text;
  • trimming accidental whitespace at line edges;
  • removing blank lines you know are only copy-and-paste gaps.

Even these can damage indentation or paragraph spacing, so inspect the preview.

Review carefully

  • Duplicates: removes later matching lines;
  • Sort or reverse: changes sequence;
  • Join: removes line boundaries;
  • Find and replace: changes matching content;
  • NFKC: can change character forms;
  • Whitespace collapse: can change alignment.
Read controls by purpose

Understand the controls without memorising a catalogue

Each group answers a different question: what spacing should change, which lines should remain, whether order matters, and how the result should be reused.

Basic cleanup

Trim beginning and end Default: on
Removes whitespace outside the complete text. Choose it for accidental padding around a paste. Check the first and last visible content, especially when either begins with indentation.
Trim each line Default: on
Removes whitespace from both edges of every line. Choose it for a plain copied list. Check outlines, code-like text, and aligned columns because their leading spaces can be meaningful.
Collapse repeated spaces and tabs Default: off
Shortens horizontal whitespace runs to one ordinary space while keeping line breaks; the next control can exempt leading indentation. It changes Green pears to Green pears. Check alignment afterward.
Preserve indentation Selected, but inactive until collapse is on
Protects leading whitespace from the collapse stage. It cannot restore indentation already removed by Trim each line, so turn that earlier option off when indentation matters.
Remove empty lines Default: off
Removes lines with no non-whitespace content. Choose it for accidental list gaps. Check paragraph breaks and section spacing before keeping the result.

Duplicate and line-order tools

Remove duplicate lines Default: off
Keeps the first matching processed line and removes later matches. Use it only when repetition is unwanted; then inspect which spelling and capitalisation survived.
Duplicate matching Default: Case-sensitive
Case-sensitive keeps Apple and apple as different lines. Case-insensitive may treat them as the same. The selector becomes available after duplicate removal is enabled.
Line order Default: Keep original order
Choose one mutually exclusive mode: keep, A–Z, Z–A, or reverse. Check whether sequence carries meaning before changing it.

Join lines

Keep line breaks Default
Leaves each processed item on its own line.
Spaces, commas, or semicolons
Places , , , or ; between processed lines. Check the destination format and remember that visible line boundaries disappear.
Custom separator
Inserts your exact plain-text value between lines. It is not interpreted as HTML. The field accepts up to 10,000 characters.

Literal find and replace

Find text Default: empty, so replacement is off
Enter the exact characters to find. An empty Find value is ignored; punctuation has no pattern meaning.
Replace with
Enter the exact replacement. It may be shorter, longer, or empty; an empty replacement deletes each selected match.
Match case Default: on
Requires uppercase and lowercase to agree. Clear it only when capitalisation differences should not matter.
Replace all matches Default: on
Changes every non-overlapping literal match. Clear it to change only the first match, then inspect the complete output.

Advanced text handling

Line endings Default: LF
Choose Preserve pasted line endings, LF, or CRLF for the generated result. The textarea may display them identically; practical details appear later.
Unicode normalisation Default: None
NFC can align canonically equivalent representations. NFKC also applies compatibility changes and shows a warning. Leave this off unless the task requires it.

Output actions

Load example
Loads the fruit list and resets every option to its default.
Copy and Download cleaned text
Use the reviewed generated string. Download creates foxger-cleaned-text.txt as a local UTF-8 text file through the browser.
Use output as input
Replaces the input with the current output without resetting the controls. Active operations run again, so use it deliberately.
Clear
Empties both text boxes, clears the current result, and restores the default controls.
Follow one list

Clean the copied fruit list step by step

Make one decision, inspect its effect, and then continue. The goal is not to select every option.

  1. Load the copied-list example

    Action: Select Load example. Foxger restores the default controls and places the fruit list in the input.

    Reason: Starting from the same source makes every later change easy to compare.

    Check: Find outside spaces, three spaces inside “Green pears”, one blank line, and two “Apples” lines.

  2. Read the default preview first

    Action: Leave the controls unchanged and compare the two text boxes.

    Reason: The defaults trim the outer boundaries and the edges of each line without removing or reordering lines.

    Check: The internal spaces, blank line, and repeated “Apples” should still be present.

  3. Collapse only the accidental spacing

    Action: Enable Collapse repeated spaces and tabs.

    Reason: The copied list needs one ordinary space between “Green” and “pears”.

    Check: That line becomes “Green pears”; all five line positions remain.

  4. Decide whether the blank line belongs

    Action: If it is an accidental gap in this list, enable Remove empty lines.

    Reason: A compact item list does not need a paragraph separator here.

    Check: The blank line disappears. In prose, the same choice could remove a meaningful paragraph break.

  5. Judge the repeated item

    Action: Enable Remove duplicate lines and leave Duplicate matching on Case-sensitive.

    Reason: Both processed “Apples” lines are exact matches, and the second one is accidental in this example.

    Check: The first “Apples” remains, the later one disappears, and Duplicates removed becomes 1.

  6. Keep or test the order deliberately

    Action: Keep original order for the final list. To see the effect, briefly try Sort Z–A, then restore Keep original order.

    Reason: Ordering is a separate decision from removing duplicates.

    Check: Z–A begins with “Mangoes”. Restore the original order if the copied sequence matters.

  7. Read the evidence below the preview

    Action: Check Character difference, Lines removed, Duplicates removed, and Operations applied.

    Reason: These values show the mechanical size of the change and which rules ran.

    Check: Lines removed should be 2 for this setup: one blank line and one duplicate line.

  8. Use the reviewed result

    Action: Copy it, download it, or select Use output as input only after the comparison looks right.

    Reason: The read-only output stays separate so the original remains available during review.

    Check: Remember that Use output as input keeps the current controls active and processes the new input again.

Reviewed result

Apples
Green pears
Mangoes

The first occurrence stays, the original useful order stays, and no line joining has happened.

Back to the Text Cleaner
Interpret the preview

Read the result summary before trusting the result

The summary describes a mechanical difference. It does not label the change correct or incorrect.

Input characters
Unicode code points in the source. A combined emoji can contain more than one.
Output characters
Unicode code points in the generated result.
Input lines
Lines found before the cleaning pipeline runs.
Output lines
Visible lines in the final result. A joined result normally has one.
Character difference
Output characters minus input characters. A negative number is shorter; a positive number begins with + and is longer.
Lines removed
Source lines removed by line processing. Joining boundaries is not counted as removing logical lines.
Duplicates removed
Later matching lines removed specifically by duplicate removal.
Operations applied
The exact stages that ran, including the selected line-ending stage.

For the walkthrough setup, Lines removed is 2 and Duplicates removedis 1. That tells you one other line—the blank one—was also removed. Replacement text, separators, or CRLF can make output longer, so Character difference is not a “characters removed” total.

One fixed pipeline

Why operation order matters

Each stage receives the result of the stage before it. Foxger always uses this order:

  1. Line endings
  2. Unicode normalisation
  3. Literal find and replace
  4. Whole-text trim
  5. Per-line trim
  6. Space and tab collapse
  7. Empty-line removal
  8. Duplicate removal
  9. Sort or reverse
  10. Join lines

The two “Apples” lines in the example begin with different outside spacing. Per-line trim runs before duplicate removal, so both become the same line; duplicate removal then keeps the first.

Name what you have already changed

Spaces, tabs, blank lines, and indentation

Whitespace is the collective name for spacing characters. The distinctions matter because one option can affect horizontal gaps while leaving line boundaries alone.

Visible teaching marks — not text to paste

Apple··pear· means an ordinary space→Orange means one tab hereApple↵Pear means a line breakApple↵↵Pearthe middle position is a blank line

Indentation is whitespace at the beginning of a line. To collapse later gaps while keeping indentation, turn off Trim each line, enable collapse, and leavePreserve indentation selected:

Input

List
    Green   pears

Output

List
    Green pears

If meaningful indentation begins at the very start of the complete text, turn off Trim beginning and end too. Preserve indentation affects only whitespace collapse; it does not undo either earlier trim stage.

Keep the first match

Duplicate lines

Apple
apple
Apple

Before looking at the answer: what remains with Case-sensitive matching?

Show the duplicate result

Case-sensitive: the first Apple and apple remain. The third line matches the first and is removed.

Case-insensitive: only the first Apple remains.

Foxger compares each complete line after earlier trim and whitespace choices have run. The case-insensitive mode uses locale-independent lowercase comparison, so it is not tailored to every language. Neither mode can recognise whether repetition is intentional.

Change sequence deliberately

Sorting and reversing are not duplicate removal

Keep duplicate removal off for a moment and use the cleaned example with both “Apples” lines:

Apples
Green pears
Apples
Mangoes

Sort A–Z

Apples
Apples
Green pears
Mangoes

Reverse original order

Mangoes
Apples
Green pears
Apples

A–Z and Z–A use the browser’s English sorting rules, handle numbers naturally, and ignore case for the main comparison. Accented or non-English text may not follow the order expected in every language. Reverse does no alphabetic comparison; it flips the current line sequence.

Choose the final separator

Joining lines removes line boundaries

Start with the reviewed three-line result:

Apples
Green pears
Mangoes
Outputs from each Join lines choice
ChoiceGenerated output
SpacesApples Green pears Mangoes
CommasApples, Green pears, Mangoes
SemicolonsApples; Green pears; Mangoes
Custom | Apples | Green pears | Mangoes

Keep line breaks is the default. Other choices create one visible output line. The summary does not count joining as removed logical lines because the items still exist; only their separator changed.

Match exact text

Literal find and replace

Suppose the copied list should say “oranges” instead of “pears”:

Find text
pears
Replace with
oranges
Reviewed output
Apples
Green oranges
Mangoes

The search is literal. A full stop matches a full stop; an asterisk matches an asterisk. Text Cleaner does not support regular expressions.

Match case requires capital letters to agree. Replace all matches changes every match; clear it to change only the first. An empty Find value does nothing, while an empty replacement removes matches. Replacements can make output shorter or longer, and Foxger stops before a result would exceed the output limit.

Optional advanced choice

Unicode normalisation can wait until you need it

Open NFC and NFKC details

Text that looks alike can sometimes use different underlying Unicode sequences. Foxger leaves Unicode normalisation on None by default.

NFC gives canonically equivalent text a composed normal form where possible. For example, Cafe + combining accent becomes Café in the tested implementation.

NFKC also applies compatibility normalisation. The tested inputABC ① becomes ABC 1. That visible change may be useful for a particular comparison or system, but it may remove a distinction you need.

Optional file-format detail

LF and CRLF may look the same in the preview

Open line-ending details

Line endings are invisible separators between lines. Foxger offers three choices:

  • LF is the default and uses one LF character for each generated line break.
  • CRLF uses a CR followed by LF for each generated line break.
  • Preserve pasted line endings uses the first raw line-ending style available in the tracked input. An explicit paste is how Foxger can retain CRLF or CR before the textarea normalises its display.

A browser textarea normalises what it displays, so LF and CRLF can look identical. The generated string kept behind the preview uses the selected style; Copy and Download use that generated result. Download creates a UTF-8 .txt file locally through the browser.

Choose a specific style only when the destination requires it. Foxger does not need an operating-system rule to clean an ordinary pasted list.

What happens to the text

Cleaning and downloads stay in the browser workflow

JavaScript bundled with the Foxger page cleans the text locally. Foxger does not upload the input to a cleaning API, and the application does not intentionally store it in local storage, session storage, IndexedDB, cookies, or the page URL. Input and output remain separate in page memory until you replace or clear them.

Copy writes the result only after you select the button. Download creates a temporary browser Blob URL and lets the browser handle the local file; Foxger does not upload that file.

The separate foxger-theme preference may store System, Light, or Dark. Ordinary page and asset requests, including routine hosting and security logs, remain governed by theFoxger Privacy page; text entered after the page loads is not added to those ordinary requests by the cleaning workflow.

Mistake, consequence, correction

Common mistakes

  1. Removing a repeated line that was intentional

    Consequence: A repeated warning, quantity, name, or refrain disappears after its first occurrence.

    Correction: Leave duplicate removal off until you know why each repetition exists.

  2. Sorting text whose order carries meaning

    Consequence: Instructions, rankings, dates, or story lines no longer follow their intended sequence.

    Correction: Use Keep original order unless alphabetical or reversed order is part of the task.

  3. Trimming or collapsing meaningful indentation

    Consequence: An outline, plain-text table, or code-like block can lose its visual structure.

    Correction: Turn off Trim each line; when needed, also turn off Trim beginning and end, then keep Preserve indentation selected.

  4. Joining lines too early

    Consequence: Item boundaries disappear, so later review and line-based cleanup become harder.

    Correction: Finish blank-line, duplicate, and ordering decisions before choosing a join separator.

  5. Using NFKC without inspecting symbols

    Consequence: Compatibility characters can become visibly different ordinary forms.

    Correction: Leave normalisation on None unless you have a reason; compare NFKC output character by character.

  6. Expecting a regular-expression pattern

    Consequence: Characters such as a full stop, bracket, or asterisk are searched as ordinary text.

    Correction: Enter the exact literal characters you want to replace; use another tool for pattern-based work.

  7. Choosing case-insensitive duplicates by accident

    Consequence: “Apple”, “apple”, and “APPLE” can collapse to the first version even when capitalisation matters.

    Correction: Keep Case-sensitive matching when letter case distinguishes the lines.

  8. Reusing output before checking it

    Consequence: The reviewed boundary between original and result disappears, and active operations run again.

    Correction: Compare both boxes and the result summary before selecting Use output as input.

  9. Assuming Foxger understands the list

    Consequence: A mechanically neat result can still remove useful content or keep an editorial mistake.

    Correction: Treat the preview as transformed text, not a judgment about meaning or correctness.

Start with what you see

Troubleshooting

My indentation disappeared

Likely reason: Trim each line removes leading whitespace before Preserve indentation can affect the collapse stage. Trim beginning and end can also remove indentation at the very start or end of the complete text.

Quick check: Look at both trim controls, Collapse repeated spaces and tabs, and Preserve indentation.

Next action: Turn off Trim each line. If the first line begins with meaningful indentation, turn off Trim beginning and end too; then keep Preserve indentation selected.

Limitation: Foxger cannot tell whether leading whitespace is layout, code, or an accident.

Duplicate lines are still there

Likely reason: The lines may differ in capitalisation, internal spaces, tabs, punctuation, or another character.

Quick check: Compare the complete processed lines and check Duplicate matching. Surrounding spaces are already trimmed by the defaults.

Next action: Choose the matching mode intentionally and collapse internal spacing only if those differences are accidental.

Limitation: Duplicate removal compares complete lines; it does not find sentences with similar meanings.

Capitalised lines were treated as duplicates

Likely reason: Duplicate matching is set to Case-insensitive.

Quick check: Look at the selector directly below Remove duplicate lines.

Next action: Choose Case-sensitive and review the first retained version.

Limitation: Case-insensitive comparison uses locale-independent lowercase matching, not language-specific editorial rules.

My line order changed

Likely reason: Line order is set to Sort A–Z, Sort Z–A, or Reverse original order.

Quick check: Inspect the Line order selector and the Operations applied list.

Next action: Choose Keep original order unless the new sequence is intentional.

Limitation: Foxger cannot recognise rankings, chronology, instructions, or another meaningful sequence.

My output became one long line

Likely reason: Join lines is using spaces, commas, semicolons, or a custom separator.

Quick check: Look at Join lines; Keep line breaks is the default.

Next action: Restore Keep line breaks, or choose the separator you actually need after other line operations are complete.

Limitation: Once joined, the preview cannot infer where meaningful line boundaries used to be.

Find and replace changed more text than expected

Likely reason: Replace all matches is selected by default, or Match case was cleared.

Quick check: Review the Find text, Match case, and Replace all matches controls together.

Next action: Restore Match case or clear Replace all matches when only the first exact occurrence should change.

Limitation: Replacement is literal and has no awareness of words, grammar, or context.

My characters changed after using NFKC

Likely reason: NFKC deliberately applies compatibility normalisation, which can change character forms.

Quick check: Switch between NFKC, NFC, and None while comparing the output.

Next action: Use None or NFC when compatibility changes are not part of the task.

Limitation: Foxger warns about NFKC but cannot decide whether a character distinction matters to you.

LF and CRLF look identical

Likely reason: A browser textarea displays line breaks in a normalised way even when the generated string uses a different line-ending style.

Quick check: Review the Line endings control rather than relying on the visible gap between lines.

Next action: Choose the format required by the destination, then use Copy or Download cleaned text.

Limitation: The preview is not a byte-level line-ending viewer.

My output is longer than my input

Likely reason: Replacement text, a custom separator, commas, semicolons, or CRLF line endings can add characters.

Quick check: Look for a positive Character difference and read Operations applied.

Next action: Compare the specific additions before copying; shorten the replacement or separator if they are unintended.

Limitation: Character difference reports size, not whether the added text is useful.

The page slowed down with very large text

Likely reason: Large transformations still run locally in the browser and require memory and processing time.

Quick check: Foxger shows a warning above 100,000 characters and stops input above 500,000 characters.

Next action: Pause typing, reduce the text, or process it in meaningful chunks.

Limitation: The tool also stops before generated output exceeds 1,000,000 characters.

Useful words

Glossary

These are the terms used by the controls and explanations above.

Whitespace
Characters that create spacing, including ordinary spaces, tabs, and line breaks.
Space
A horizontal gap commonly used between words on one line.
Tab
A horizontal whitespace character often used for indentation or alignment.
Indentation
Whitespace at the beginning of a line that can show structure.
Line break
An invisible character, or pair of characters, that ends one line and begins another.
Blank line
A line with no visible content. It may still contain spaces or tabs.
Duplicate
A complete processed line that matches an earlier line under the selected matching rule.
Case-sensitive
A comparison where uppercase and lowercase letters are treated as different.
Literal text
Characters matched as ordinary text, without regular-expression pattern rules.
Separator
Text placed between items when lines are joined, such as a space, comma, or custom value.
Unicode
The standard used to represent text from many languages and writing systems.
NFC
A Unicode normalisation form for canonically equivalent text.
NFKC
A compatibility normalisation form that can also change character forms.
Pipeline
A fixed sequence in which the output of one operation becomes the input of the next.
A few minutes of practice

Clean a second fruit list

Open the exercise

Paste this text into the tool:

  Mangoes

Green   pears
Mangoes
  Apples

For this exercise, treat the outside spaces, indentation, blank line, repeated item, and internal spacing as accidental. Choose settings that:

  • remove the accidental blank line;
  • keep only the first exact duplicate;
  • deliberately remove the indentation;
  • collapse the internal spaces;
  • keep the first-seen item order;
  • join the final items with commas.

Judgment question: Would sorting this text change its meaning?

Show one verified solution

Keep both default trim options on. Enable Collapse repeated spaces and tabs, Remove empty lines, and Remove duplicate lines with Case-sensitive matching. Keep original order, then choose Join with commas.

Mangoes, Green pears, Apples

Sorting would change the sequence. That matters if this is a preference ranking; it may not matter for an unordered inventory. Foxger cannot make that contextual decision.

Before copying or reusing

Final checklist

  • I kept the original text while reviewing the result.
  • I know which operations I enabled.
  • I checked whether blank or duplicate lines were intentional.
  • I checked whether indentation and line order carry meaning.
  • I reviewed replacement, joining, or Unicode normalisation if I used them.
  • I read Character difference, Lines removed, and Operations applied.
  • I checked the final output before copying, downloading, or reusing it.
Back to the Text Cleaner
Quick answers

Text Cleaner questions

Is my text uploaded to Foxger?

No. Text cleaning runs locally in your browser. Foxger does not intentionally upload, save, or add your text to the page URL.

Does Text Cleaner overwrite my input?

No. Cleanup operations write to a separate read-only output. Typing, pasting, or Load example sets the input; Use output as input deliberately replaces it with the current result, and Clear empties it.

What does Text Cleaner change by default?

By default, Foxger generates LF line endings, trims whitespace at the beginning and end of the complete text, and trims each line. It leaves internal spaces and tabs, empty lines, duplicate lines, line order, and separate lines unchanged. Unicode normalisation is off, and find and replace does not run while Find text is empty.

Does find and replace support regular expressions?

No. Version one uses literal text only, so characters such as a full stop, bracket, or asterisk have no special pattern meaning.

Which duplicate line does Foxger keep?

Foxger keeps the first matching line and removes later matches. You can choose case-sensitive or case-insensitive matching.

What is the difference between NFC and NFKC?

NFC applies canonical Unicode normalisation. NFKC also changes compatibility characters and can alter how text looks or what distinction it carries, so it requires careful review.

Can cleaning remove meaningful formatting?

Yes. Blank lines, indentation, repeated lines, and line order can carry meaning. Keep an original copy and review the separate output before using it.

Can I sort and reverse at the same time?

No. Line order is one mutually exclusive choice: keep the original order, sort A–Z, sort Z–A, or reverse the current order.

Can I download the cleaned text?

Yes. Download creates a local UTF-8 text file through your browser. Foxger does not upload the generated file.

Does Foxger understand what my text means?

No. The cleaner applies deterministic text rules. It does not understand meaning, grammar, sensitivity, or whether a change is editorially correct.

Optional support

Help keep Foxger useful

Foxger tools are free, private, and built without display ads. Optional support helps keep them maintained, tested, and documented.

Support Foxger