Strips all whitespace characters (spaces, tabs, newlines) from any text string. Use via MCP in Cursor or Windsurf for cleaning user input, or call GET /v1/string/remove-whitespace with your text. Perfect for sanitizing data before validation or creating compact identifiers. Returns the exact input with every whitespace character removed.
curl "https://tinyfn.io/v1/string/remove-whitespace" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/remove-whitespace', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/string/remove-whitespace',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:
{
"mcpServers": {
"tinyfn-string": {
"url": "https://tinyfn.io/mcp/string",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Removes all Unicode whitespace: spaces, tabs, newlines, carriage returns, form feeds, and other whitespace characters like non-breaking spaces.
Call the remove_whitespace tool with your text parameter. Works in Cursor, Claude Code, Windsurf, and other MCP-compatible editors for instant text cleaning.
Yes, all non-whitespace characters remain unchanged including Unicode symbols, emojis, and special characters. Only whitespace is removed.
Trim only removes leading/trailing whitespace. This removes ALL whitespace throughout the entire string, including spaces between words.
Partially - it removes spaces but doesn't handle other URL-unsafe characters. You'd need additional URL encoding for complete safety.
Get your free API key and start using Remove Whitespace in seconds.
Get Free API Key