Case Converter/ camelCase · snake_case · kebab-case

Convert any text between camelCase, PascalCase, snake_case, kebab-case, and 8 more naming formats — instantly.

Input
camelCase
helloWorld
PascalCase
HelloWorld
snake_case
hello_world
kebab-case
hello-world
UPPER_SNAKE_CASE
HELLO_WORLD
Title Case
Hello World
Sentence case
Hello world
lowercase
hello world
UPPERCASE
HELLO WORLD
dot.case
hello.world
path/case
hello/world

Did this tool solve your problem?

What is a case converter tool

A case converter tool converts text between different naming formats with one click, including camelCase, PascalCase, snake_case, kebab-case, UPPER_SNAKE_CASE, and 11 other common formats. Developers frequently need to switch between naming styles when writing code — manual conversion is error-prone and time-consuming.

Common naming convention use cases

JavaScript variables and functions use camelCase, classes use PascalCase; Python uses snake_case for variables and functions; CSS class names and URL slugs use kebab-case; constants use UPPER_SNAKE_CASE. Following language and framework conventions improves code readability and consistency.

Code Examples

JavaScript / TypeScript
// lodash
import { camelCase, snakeCase, kebabCase, startCase } from "lodash";

camelCase("hello world")   // "helloWorld"
snakeCase("helloWorld")    // "hello_world"
kebabCase("HelloWorld")    // "hello-world"
startCase("hello_world")   // "Hello World"

// change-case (lightweight)
import { camelCase, pascalCase, snakeCase } from "change-case";
camelCase("foo bar")       // "fooBar"
pascalCase("foo-bar")      // "FooBar"
Python
import re

def to_snake(s):
    s = re.sub(r'([A-Z]+)([A-Z][a-z])', r'\1_\2', s)
    s = re.sub(r'([a-z])([A-Z])', r'\1_\2', s)
    return s.lower().replace('-', '_').replace(' ', '_')

def to_camel(s):
    words = re.split(r'[_\-\s]+', s)
    return words[0].lower() + ''.join(w.title() for w in words[1:])

# pip install stringcase
from stringcase import camelcase, snakecase, pascalcase
camelcase("hello_world")   # "helloWorld"
snakecase("helloWorld")    # "hello_world"
Go
// go get github.com/iancoleman/strcase
import "github.com/iancoleman/strcase"

strcase.ToCamel("hello_world")       // "HelloWorld"
strcase.ToLowerCamel("hello-world")  // "helloWorld"
strcase.ToSnake("helloWorld")        // "hello_world"
strcase.ToKebab("HelloWorld")        // "hello-world"
strcase.ToScreamingSnake("helloW")   // "HELLO_W"
Shell
# snake_case to kebab-case
echo "hello_world" | tr '_' '-'
# hello-world

# to UPPER_SNAKE_CASE
echo "hello world" | tr '[:lower:] ' '[:upper:]_'
# HELLO_WORLD

# Python one-liner
python3 -c "
import re, sys
s = sys.stdin.read().strip()
print(re.sub(r'([a-z])([A-Z])', r'\1_\2', s).lower())
" <<< "helloWorld"

Frequently Asked Questions

What's the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter, then capitalizes each subsequent word (e.g., helloWorld). PascalCase capitalizes every word including the first (e.g., HelloWorld). JavaScript variables and functions typically use camelCase; class and component names use PascalCase.
When should I use snake_case?
snake_case uses all lowercase with underscores between words. It's the official Python style (PEP 8) for variables, functions, and file names. Database column names and Linux environment variables commonly use this format too.
What's the difference between kebab-case and snake_case?
kebab-case uses hyphens (-) between words; snake_case uses underscores (_). kebab-case is standard for CSS class names, HTML attributes, and URL slugs (e.g., my-page-title). snake_case is more common in programming language identifiers.
What is UPPER_SNAKE_CASE used for?
UPPER_SNAKE_CASE (also called SCREAMING_SNAKE_CASE) is the convention for constants in most languages — e.g., MAX_RETRY_COUNT, API_BASE_URL. Python, Java, and JavaScript all use this style for global constants and enum values.
How does the tokenizer work?
The tool splits input into word tokens by detecting camelCase boundaries (lowercase→uppercase transitions), underscores, hyphens, dots, slashes, and spaces. Each token is then reassembled according to the target format's rules.
What are dot.case and path/case used for?
dot.case separates words with dots (e.g., hello.world) — common in configuration file keys and Java package names (com.example.app). path/case uses slashes (e.g., hello/world) — common in file paths and URL segments.