Case Conversion Utilities

To Constant Case

Converts text to CONSTANT_CASE format (uppercase with underscores). Access via `/v1/case/constant` endpoint or MCP in Cursor and other editors. Transform "hello world" to "HELLO_WORLD" instantly. Also called screaming snake case — perfect for environment variables and configuration constants.

API Endpoint

GET /v1/case/constant

Code Examples

curl "https://tinyfn.io/v1/case/constant" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/case/constant', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/case/constant',
    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 case conversion tools:

{
  "mcpServers": {
    "tinyfn-case": {
      "url": "https://tinyfn.io/mcp/case",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What is CONSTANT_CASE and when should I use it?

CONSTANT_CASE uses uppercase letters with underscores separating words (API_KEY, MAX_RETRY_COUNT). It's the standard convention for constants, environment variables, and configuration values in most programming languages.

How do I convert text to CONSTANT_CASE using MCP?

Use the to_constant_case tool in MCP-enabled editors like Cursor or Windsurf. Pass your text as input and get deterministic CONSTANT_CASE output for variable names and constants.

What's the difference between CONSTANT_CASE and SCREAMING_SNAKE_CASE?

They're the same format — CONSTANT_CASE is an alias for screaming snake case. Both produce uppercase text with underscores, like DATABASE_URL or HTTP_TIMEOUT.

Does the tool handle special characters and numbers?

Yes, it converts alphanumeric text and handles special characters by replacing or removing them appropriately. Numbers are preserved: "api-key-2" becomes "API_KEY_2".

Can I use this for generating environment variable names?

Absolutely. CONSTANT_CASE is the standard for environment variables across languages and platforms. Convert "database connection string" to "DATABASE_CONNECTION_STRING" for use in .env files.

Try To Constant Case Now

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

Get Free API Key