How to use
- Paste the text you want to clean into the box.
- Press Remove to strip the punctuation.
- Copy the cleaned text from the output.
- Check hyphenated words and contractions — they are joined together (ali-khan → alikhan, It’s → Its).
- If your text contains accented letters (é, ñ, ü) or Urdu, Arabic or Hindi script, do not use this tool as-is; those characters are removed as well.
- Run a whitespace clean-up afterwards if you need single spaces, because removed symbols can leave double spaces behind.
Formula / how it works
The tool runs one regular-expression replacement on your text:
text.replace(/[\p{P}\p{S}]/gu, '')
Read it as: "delete every character whose Unicode category is Punctuation (\p{P}) or Symbol (\p{S})". The u flag makes the pattern Unicode-aware, so letters from every script (Latin with accents, Urdu, Arabic, Hindi, Chinese), digits and whitespace are kept. \p{P} covers full stops, commas, quotes, dashes, brackets, the underscore (category Pc) and script-specific marks such as the Urdu comma "،" and question mark "؟". \p{S} covers currency signs ($, £, ₨), maths symbols (+, =, <) and emoji.
Unicode-safe. An ASCII-only pattern such as [^\w\s]|_ would delete é, ñ and every non-Latin letter, turning "Café — naïve résumé" into "Caf nave rsum". This tool returns "Café naïve résumé", and Urdu text such as "قیمت: ۵۰۰ روپے، شکریہ!" becomes "قیمت ۵۰۰ روپے شکریہ" with the letters and Urdu digits intact.
Symbols go too. Because \p{S} is included, "Price: $5 + tax = £6" loses the $, +, = and £. If you need currency signs kept, this tool is too aggressive; edit those by hand afterwards.
Numbers change meaning. "9:30" becomes "930", "3.5" becomes "35" and "1,250" becomes "1250". Check any figures after cleaning, especially decimals.
Leftover spaces. In "Café — naïve", the em dash sits between two spaces; removing it leaves two spaces in a row. Collapse with a replace of /\s+/g to " " if needed.
Typical uses in data work. Cleaning survey answers before counting word frequencies, normalising product names before de-duplication, or preparing a quick bag-of-words for a classroom NLP exercise. For production text processing, use a library that understands Unicode and language-specific rules.
Removing punctuation but keeping some marks. Sometimes you want to strip most symbols but keep apostrophes in contractions, or hyphens in compound words. This tool has no exceptions list. A quick workaround is to replace the marks you want to keep with a placeholder word (for example change - to HYPHENX in a text editor), run the tool, then replace the placeholder back.
Worked examples
Everyday sentence
Inputs: Hello, world! It's 9:30 a.m.
Paste the text and press Remove. The comma, exclamation mark, apostrophe, colon and both full stops are deleted; letters, digits and spaces stay.
Result: Hello world Its 930 am
Note how 9:30 became 930 and a.m. became am.
Code-like identifiers
Inputs: user_name: ali-khan (admin)
Paste and Remove. The underscore is connector punctuation (Pc), so \p{P} removes it along with the colon, hyphen and brackets.
Result: username alikhan admin
Useful for matching usernames regardless of separators.
Accented text
Inputs: Café — naïve résumé
Paste and Remove. é and ï are letters (category L), so they stay; only the em dash (category Pd) is deleted, leaving a double space where it was.
Result: Café naïve résumé
Collapse the double space with a find-and-replace if needed.
Use cases
- Preparing English text for a word-frequency count or word cloud.
- Normalising product names or tags before de-duplicating a list.
- Cleaning pasted spreadsheet data that contains stray symbols.
- Stripping symbols from usernames or identifiers for comparison.
- Simple classroom exercises on text pre-processing.
Tips & limitations
- Replace hyphens with spaces first if you want "well known" instead of "wellknown".
- Check decimals and times after cleaning.
- Collapse double spaces afterwards for tidy output.
- Use a Unicode-aware tool for accented or non-Latin text.
- Keep a copy of the original; the change cannot be undone in the output box.
FAQ
Which characters does the tool keep?
English letters A–Z and a–z, digits 0–9 and whitespace (spaces, tabs, line breaks). Everything else is removed.
Why did my accented letters disappear?
They no longer should: the tool now uses Unicode categories and keeps letters from every script. If you saw this before, it was the old ASCII-only pattern.
Does it remove underscores?
Yes. Underscores are technically word characters in regex, so the pattern removes them explicitly.
Will it keep line breaks?
Yes. Line breaks are whitespace and are kept, so paragraph structure survives.
Does it remove emoji?
Yes. Most emoji are in the Symbol (So) category, so \p{S} deletes them. Currency and maths signs are removed for the same reason.
Can it work on Urdu text?
Not correctly — Urdu letters would be deleted along with the punctuation. A Unicode-aware pattern such as [^\p{L}\p{N}\s] with the u flag is needed.
Is my text sent anywhere?
No. The replacement happens entirely in your browser.
Runs entirely in your browser; your text is not uploaded. Counts and scores are heuristics, so review the output before you publish it.