Remove punctuation
Converted in your browser · nothing is uploaded
Removes punctuation from text, including the smart quotes and dashes that word processors insert and that a simple character list misses.
How to use the remove punctuation
The punctuation people forget is the typographic kind. A word processor silently replaces " with “ and ”, ' with ’, and -- with —, so text copied out of one contains characters that are not on a keyboard and are not in the ASCII punctuation range. A remover built from a list of typed characters leaves every one of them behind, which is why the result still looks wrong.
The apostrophe is the case that needs a decision rather than a rule. Removing it turns isn’t into isnt and it’s into its — which is what you want for text analysis, where the words should match regardless of contraction, and wrong for anything a person will read. There is no correct answer that suits both, so it is worth checking the output rather than assuming.
A common reason for wanting this is preparing text for comparison or search: punctuation makes two otherwise identical strings differ, and stripping it is the standard normalisation step alongside lowercasing and removing accents. For that purpose removing the apostrophe is right.
Questions
Yes. Those are the ones a simple character list misses, and the reason the result usually still looks wrong.