Skip to content
100% local

Truncate at word

Cut text at the first occurrence of a keyword and keep only the part before or after it.

Input
Output

Truncate at word

Paste any text and give this tool a keyword — it finds the first place that word or phrase appears and keeps only the part before it or only the part after it, dropping the rest. Use it to strip a footer off an email thread, pull just the header out of a document, cut a log file at the line containing a specific token, or isolate one half of any text that has a clear dividing marker.

Choose "Before" to keep everything up to the first match, or "After" to keep everything from the first match onward. Turn on "Include keyword" if the marker itself should stay attached to the kept side — handy when the keyword is really the start of a section you want to keep, like a heading. Case-insensitive matching lets "END", "end" and "End" all count as the same marker, so you do not have to match the exact capitalisation used in the source text.

The search always looks for the first occurrence, scanning across the whole text rather than line by line, so a keyword split across two paragraphs is still found correctly. If the keyword never appears, or the field is left empty, the text passes through unchanged instead of returning an error — the marker simply was not there.

Everything runs locally in your browser. Nothing you paste is uploaded, logged or sent anywhere, so it is safe to trim confidential logs, internal documents or personal messages. Copy the result, download it as a .txt file, or send it to another tool to continue cleaning up the text.

FAQ

What happens if the keyword isn't in the text?
The text is returned exactly as you pasted it — no error, no truncation. The keyword simply wasn't found.
Does 'Include keyword' change which side keeps the marker?
Yes. With it on, the keyword text stays attached to whichever side you kept — the end of the "before" part or the start of the "after" part. With it off, the keyword is dropped from the result entirely.
Can I match a keyword regardless of capitalisation?
Enable "Case-insensitive" and "END", "end" and "End" all count as a match, though the kept text preserves its original capitalisation.
Is my text uploaded anywhere?
No. Truncation runs entirely in your browser and your text never leaves your device.