How to clean a translation memory
Updated · 7 min read · by the TM Cleaner team at terratra
A translation memory gets worse the longer it is used without maintenance. Every project, alignment and pre-translation run adds units, and nothing takes them out again. This guide covers how to clean a translation memory safely: what to remove, what to keep, and how to check the result before it replaces the TM your work depends on.
Why translation memories need cleaning
A TM decays in three ways.
- Duplicates. The same source sentence collects several translations: a reviewer's fix, an older variant, a colleague's alternative. Your CAT tool then offers competing 100% matches, and the one it shows first is not always the current one.
- Junk. Units that hold nothing a translator can reuse: a URL, a phone number, a lone tag, a file path. They inflate word counts and analyses, and they add noise to fuzzy matching.
- Machine translation and broken units. Pre-translation writes raw machine output into the TM, where it looks exactly like human work. Empty targets, targets that are just a copy of the source, and encoding damage (é stored as é) sit there until someone reuses them.
A clean TM is smaller and faster to search. It offers fewer conflicting matches, and it is safe to use as training data for MT or AI models. A TM that has never been cleaned typically shrinks by a third to a half.
Before you start
- Keep a backup. Export the untouched TM and keep the file. A clean should always produce a new TM, never overwrite your only copy.
- Decide what the TM is for. A TM for everyday leverage, a TM you deliver to a client and a TM that becomes MT training data need different levels of cleaning. For leverage, remove duplicates and junk but keep anything a translator might reuse. For training data, cut hard: machine output, fragments, untranslated units and anything with encoding damage.
- Check whether you rely on context matches. Some CAT tools give a higher match when the surrounding segments also match (Trados calls it a context match, memoQ a 101% match). There, the same source can correctly have different translations in different places. If that matters to you, remove only exact copies (same source and same target) instead of merging different translations of one source.
Step 1: Export the TM as TMX
TMX (Translation Memory eXchange) is the open XML format that every CAT tool can export and import, which makes it the common ground for cleaning. If you are not sure what is inside one, our homepage explains the TMX format in two paragraphs.
- Trados Studio: in the Translation Memories view, select the TM and choose Export, then save it as a .tmx file. What Trados exports tend to contain.
- memoQ: in the Resource Console, open Translation memories, select the TM and export it to TMX. memoQ specifics.
- Phrase (Memsource): open the translation memory and export it in TMX format. Phrase specifics.
- OmegaT: there is nothing to export. The working memory is
omegat/project_save.tmxinside the project folder. OmegaT specifics. - XTM, Smartcat, Crowdin and others: use the TM export function and choose TMX. See the notes for XTM, Smartcat and Crowdin.
Step 2: Decide what to remove
This is the step that decides whether a clean helps or hurts. Sort what you find into three groups.
Safe to remove
- Exact duplicates, with the same source and the same target. Removing them loses no information at all.
- Units that are only a URL, an email address, a number, a phone number, a file path, a tag or a placeholder.
- Units with an empty target.
Remove, but choose carefully
- Different translations of the same source. Keep one per source and choose it on purpose: the most recent (usually the reviewed version), the most frequent (the team's consensus) or the one from a translator you trust. Don't let “whichever came first” decide by accident. More on deduplication.
- Machine-translated units. Remove them if the TM should hold only human work or will feed MT training. The text won't tell you which units they are, so look at the creation and change IDs in the metadata. How MT units are found.
- Untranslated units, where the target is a copy of the source. Usually a mistake, but product names, code and some UI labels are legitimately identical in both languages.
Usually keep
- Short UI strings such as “Save” or “Open”. They look like fragments, but they are real translations, and the same word can need different translations as a verb and as a noun, so don't merge them blindly.
- Numbers and tags inside real sentences. Only a unit that consists of nothing but numbers or tags is junk.
- Units with inline formatting tags. The tags carry the formatting. A unit is not junk because it has them.
Step 3: Clean and preview
You can clean in your CAT tool's TM editor by filtering units and deleting them. That works for a few hundred units. It doesn't scale to a TM with 200,000, and choosing the right variant for every duplicate by hand is not realistic.
A TMX cleaner does it in one pass. With TM Cleaner you upload the TMX and it scans the file and shows the result before anything changes. You see every duplicate group with the variant it would keep, and every junk category with examples and counts. Pick a preset (Lenient, Balanced or Strict), switch any rule off, choose a different winner for a group or keep an individual unit, and the numbers update. Nothing is removed until you confirm. It is free: you can preview a file up to 50 MB without an account, and a sign-in by email link lets you clean files up to 2 GB.
Whatever you use, read 20 to 30 examples in each category before you accept it, especially untranslated and short units. That is where a general rule most often meets a legitimate exception.
Step 4: Check the result
- Look at what was removed, not only at what is left. TM Cleaner gives you
removed.csv, with every removed unit and the reason, andremoved.tmx. Sort the CSV by reason and skim each group. - Run an analysis. Import the cleaned TMX into a new, empty TM and analyse a recent project against both the old and the new TM. 100% and high fuzzy matches should stay the same or improve. If they drop noticeably, something useful was removed.
- Remember nothing is lost. Importing the cleaned file and removed.tmx together rebuilds the original TM.
Step 5: Import the cleaned TM
- Import into a new TM with the same language pair and the same fields as the old one. Importing into the old TM adds and updates units but never deletes the ones you removed.
- Your metadata survives. TM Cleaner writes every kept unit back exactly as it was, with its attributes, properties, notes and dates, so your fields and filters keep working. The one exception is encoding repair, which changes the damaged text when you switch it on.
- Switch your projects to the new TM and keep the old one, with your backup export, until you are sure.
How often to clean
- Before you migrate to another CAT tool or merge TMs.
- Before a TM becomes MT or AI training data.
- After large projects, alignments or pre-translation runs.
- Otherwise, a routine clean once or twice a year keeps a busy TM in shape.
Questions
Will cleaning lower my match rates?+
Removing junk and exact duplicates can't: those units never produced a useful match. Merging different translations of the same source changes which translation you are offered, not whether you get a match. Step 4 shows how to confirm it with an analysis before you switch TMs.
Can I undo a clean?+
Yes, if you keep the file of removed units. With TM Cleaner, importing removed.tmx together with the cleaned file restores every unit. Keep your original export in your backups as well.
Is it safe to upload a client's translation memory?+
Check that your agreement with the client allows processing by an outside tool. TM Cleaner deletes the upload from storage the moment cleaning finishes, and the download links stop working after an hour, when the cleaned files are deleted too.
Do I need the CAT tool that created the TM?+
No. TMX is tool-independent, so you can clean a TM exported from one tool and import the result into another. That also makes cleaning a natural step when you migrate between CAT tools.
Clean your translation memory now
Upload a TMX, preview every change, download the cleaned TM. Free, and no account needed to preview.