Case Converter/ camelCase · snake_case · kebab-case
Convert any text between camelCase, PascalCase, snake_case, kebab-case, and 8 more naming formats — instantly.
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
// 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"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 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"# 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"