A modern, responsive web application that transforms messy text into clean, readable content by removing excessive whitespace while preserving the structure and meaning of your text.
The Whitespace Cleaner is a powerful yet simple tool designed to help you clean up text that contains multiple consecutive whitespace characters (spaces, tabs, newlines). It's perfect for cleaning up copied text from PDFs, websites, or documents that have formatting issues.
- Removes excessive whitespace: Converts multiple consecutive whitespace characters into single spaces
- Preserves text structure: Maintains the content and meaning while improving readability
- Trims boundaries: Removes leading and trailing whitespace
- Real-time processing: Instantly shows cleaned results as you type
- Intelligent whitespace removal
- Real-time text cleaning
- Preserve content integrity
- Character count (before & after)
- Word count tracker
- Token count with breakdown
- Live-updating statistics
- Dark theme
- Responsive across devices
- Smooth UI animations
- Keyboard + screen reader accessible
- One-click copy
- Smart visual feedback
- Undo last clear
- Clear all with confirmation
- Fully tested on Safari
- Uses backdrop filters with fallbacks
- Paste or type text in the Original Text panel
- View the Cleaned Text on the right
- Check live stats for characters, words, and tokens
- Click Copy to save cleaned text
- Use Clear All to reset
Before:
This text has multiple spaces and
weird formatting.
After:
This text has multiple spaces and weird formatting.
- React 18
- Vanilla CSS (Grid & Flexbox)
- Babel Standalone (in-browser JSX)
- No build tools required — single
index.htmlfile - https://claude.ai/chat/d2adf472-76b6-4bf9-b39c-5ce770203809
- https://chatgpt.com/c/68469897-31dc-8012-850e-14ea61ade544
- ✅ Chrome (latest)
- ✅ Firefox (latest)
- ✅ Safari 9+
- ✅ Edge
- ✅ Mobile
- Memoized calculations (
useMemo) - Debounced input handler
- Lightweight (only React CDN used)
Empty-White-Space-Cleaner/
├── index.html # Main single-page app
├── README.md # This documentation
└── .git/ # Git data
git clone https://github.com/Jason-Mendes/Empty-White-Space-Cleaner.git
cd Empty-White-Space-CleanerThen just open index.html in your browser, or use:
python -m http.server 8000- Push code to GitHub
- Go to Settings → Pages
- Choose "Deploy from a branch" →
main→/ (root) - Access your app at:
https://yourusername.github.io/Empty-White-Space-Cleaner/
- Netlify: drag & drop
index.html - Vercel: connect your GitHub repo
- Any Web Server: upload the
index.htmlfile
- Clean up copied text from PDFs
- Format text for blogs, docs, social posts
- Clean config files or documentation
- Format output logs or code comments
- Clean research notes
- Format citations
- Prep manuscripts for submission
-
Fork this repo
-
Create a feature branch:
git checkout -b feature/amazing-feature
-
Edit
index.html, test changes -
Commit with a clear message:
git commit -m 'Add amazing feature' -
Push and open a pull request
- Stick to the single-file approach
- Keep styling consistent
- Test on all modern browsers
- Update the README if needed
Licensed under the MIT License.
Found a bug or have a feature request? Open an issue
- Custom whitespace pattern options
- Export to
.txt,.md, and more - Batch processing
- Side-by-side comparison mode
- Keyboard shortcuts
- Save custom cleaning presets
Made with ❤️ by Jason Mendes
Transform messy text into clean, readable content with just one click!