String Utilities

Snake Case

Transforms any text into snake_case format by converting spaces, hyphens, and camelCase to underscores with lowercase letters. Access via MCP in Cursor or Windsurf for instant variable naming, or call GET /v1/string/snake-case with your text. Perfect for database columns, Python variables, and API endpoints. Handles Unicode and preserves numbers correctly.

API Endpoint

GET /v1/string/snake-case

Code Examples

curl "https://tinyfn.io/v1/string/snake-case" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/snake-case', {
  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/snake-case',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I convert camelCase to snake_case?

The tool automatically detects camelCase patterns like 'myVariableName' and converts them to 'my_variable_name'. It preserves numbers and handles complex cases like 'XMLHttpRequest' → 'xml_http_request'.

What happens to special characters and spaces in snake case conversion?

Spaces become underscores, hyphens become underscores, and most special characters are removed or replaced. Multiple consecutive separators collapse into single underscores.

Can I use snake case conversion in MCP-enabled editors for variable naming?

Yes, invoke the snake_case tool in Cursor, Windsurf, or other MCP editors to instantly convert selected text or generate proper variable names from descriptions during coding.

Does snake case conversion handle non-English characters?

The tool processes Unicode characters appropriately, converting accented letters to their base forms and handling international text while maintaining the snake_case format.

What's the difference between snake_case and kebab-case conversion?

Snake case uses underscores (my_variable) while kebab case uses hyphens (my-variable). Snake case is preferred for programming languages, kebab case for URLs and CSS classes.

Try Snake Case Now

Get your free API key and start using Snake Case in seconds.

Get Free API Key