What does the Text Case Converter do?
The Text Case Converter transforms raw text strings between standard prose casing styles (UPPERCASE, lowercase, Title Case, Sentence case) and developer code naming conventions (camelCase, PascalCase, kebab-case, snake_case). It strips or formats delimiters and normalizes word boundaries for variable names, database identifiers, and editorial copy.
Core Concepts
Understanding letter casing conventions across prose and codebases:
- Prose Styles:
- UPPERCASE / lowercase: Converts all characters to uppercase or lowercase.
- Title Case: Capitalizes the first letter of each word.
- Sentence case: Capitalizes the first letter of each sentence following punctuation.
- Code Identifier Conventions:
- camelCase: Standard variable naming (
myVariableName). - PascalCase: Standard class and type naming (
MyClassName). - kebab-case / slug: Standard URL slug and CSS class naming (
my-kebab-slug). - snake_case: Standard database column and Python variable naming (
my_database_column).
- camelCase: Standard variable naming (
How to use the tool?
- Paste Raw Text: Enter or paste your unformatted text string into the input box or click Load Sample.
- Select Target Casing: Choose your target casing style from the dropdown menu (e.g.
camelCase,Title Case,UPPERCASE). - Execute & Export: Click Convert Text Case, then click Copy or Download to save your converted string.
Related Developer Utilities
If you work with text formatting, list processing, and string manipulation, explore these complementary tools:
- Text Whitespace Cleaner: Normalize spaces, tabs, and line endings in raw text.
- Word & Character Counter: Count words, characters, sentences, and reading time.
- Duplicate Line Remover: Strip duplicate lines from text lists.
- Text Sorter Tool: Sort text lists alphabetically, numerically, or in reverse.
REST API Integration
Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/text/case-converter) to programmatically convert text casing formats between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, kebab-case, and snake_case.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
rawText |
String | Raw text string payload to convert. | "hello world" |
targetCase |
String | Target casing format ("uppercase", "lowercase", "titlecase", "sentencecase", "camelcase", "pascalcase", "kebabcase", "snakecase"). Defaults to "uppercase". |
"camelcase" |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/text/case-converter \
-H "Content-Type: application/json" \
-d '{
"rawText": "hello world",
"targetCase": "camelcase"
}'Python
import requests
url = "https://blueutils.com/api/text/case-converter"
payload = {
"rawText": "hello world",
"targetCase": "camelcase"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"rawText": "hello world",
"targetCase": "camelcase"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/text/case-converter"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether the conversion succeeded. | true |
message |
String | Status description of the text conversion result. | "Text converted to camelcase successfully." |
result |
String | Standard result property matching the converted text. | "helloWorld" |
targetCase |
String | The casing style format requested. | "camelcase" |
converted |
String | The converted text output string. | "helloWorld" |
stats |
Object | Text metadata containing charCount, wordCount, and lineCount. |
{"charCount":11,"wordCount":2,"lineCount":1} |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"message": "Text converted to camelcase successfully.",
"result": "helloWorld",
"targetCase": "camelcase",
"converted": "helloWorld",
"stats": {
"charCount": 11,
"wordCount": 2,
"lineCount": 1
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Input text is empty.",
"message": "Input text is empty."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to convert text casing?
Integrating the Text Case Converter API into scaffolding CLI generators, content management systems, or database schema migration scripts provides key benefits:
- Rapid Script Validation: Normalizes user inputs and converts object property names into consistent database column conventions.
- Optimized Token Efficiency for AI Agents: LLMs often make capitalization errors or drop word characters when converting long lists of variable identifiers. The API performs 100% deterministic string casing without token hallucination.
- Deterministic Accuracy Without Hallucinations: Ensures 100% accurate string tokenization, regex boundary preservation, and Unicode support.
Native Usage
How to convert text casing locally in terminal environments or scripts:
Windows (CMD / PowerShell)
# Convert to UPPERCASE in PowerShell
"hello world".ToUpper()Linux / Unix (Bash)
# Convert to UPPERCASE using tr in Bash
echo "hello world" | tr '[:lower:]' '[:upper:]'Python
Using Python string methods:
text = "hello world"
print("Upper:", text.upper())
print("Lower:", text.lower())
print("Title:", text.title())
print("Snake:", text.replace(" ", "_").lower())Java
Using Java String API:
public class TextCaseExample {
public static void main(String[] args) {
String text = "hello world";
System.out.println("Upper: " + text.toUpperCase());
System.out.println("Lower: " + text.toLowerCase());
}
}