Text Cleanup

Capitalize Sentences

Fix casing by capitalizing the first letter of each sentence.

Explanation

Corrects text written in all-lowercase or with inconsistent capitalization.

Examples

Bad Casing
Input
hello world. this is a test. i am coding.
Output
Hello world. This is a test. I am coding.

Code Examples

JavaScript
const fixed = input.replace(/(^\s*|\.\s+)([a-z])/g, m => m.toUpperCase());

Try it Now

💡 Tips

  • Account for both periods, question marks, and exclamation points
  • Watch out for abbreviations (e.g., "e.g.")
  • Useful for cleaning up user-generated comments

⚠️ Common Pitfalls

  • Can incorrectly capitalize letters after decimal points in numbers