대소문자 변환/ camelCase · snake_case · kebab-case

임의의 텍스트를 camelCase, PascalCase, snake_case, kebab-case 등 11가지 명명 형식으로 즉시 변환합니다.

입력 텍스트
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

이 도구가 도움이 되었나요?

대소문자 변환 도구란

대소문자 변환 도구는 camelCase, PascalCase, snake_case, kebab-case, UPPER_SNAKE_CASE 등 11가지 일반적인 형식 간에 텍스트를 원클릭으로 변환합니다.

일반적인 명명 규칙 사용 사례

JavaScript 변수와 함수는 camelCase, 클래스는 PascalCase를 사용. Python은 변수와 함수에 snake_case를 사용. CSS 클래스명과 URL 슬러그는 kebab-case, 상수는 UPPER_SNAKE_CASE를 사용합니다.

코드 예제

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"

자주 묻는 질문

camelCase와 PascalCase의 차이점은?
camelCase(로워 카멜)는 첫 단어의 첫 글자를 소문자로, 이후 단어의 첫 글자를 대문자로 씁니다(예: helloWorld). PascalCase(어퍼 카멜)는 모든 단어의 첫 글자를 대문자로 씁니다(예: HelloWorld). JavaScript 변수/함수는 camelCase, 클래스/컴포넌트 이름은 PascalCase가 일반적입니다.
snake_case는 언제 사용해야 하나요?
snake_case는 모두 소문자에 단어 사이에 언더스코어를 사용합니다. Python의 공식 스타일(PEP 8)로, 데이터베이스 컬럼명과 Linux 환경 변수에서도 일반적입니다.
kebab-case와 snake_case의 차이점은?
kebab-case는 하이픈(-), snake_case는 언더스코어(_)로 단어를 구분합니다. kebab-case는 CSS 클래스명, HTML 속성, URL 슬러그에, snake_case는 프로그래밍 언어 식별자에 일반적입니다.
UPPER_SNAKE_CASE는 언제 사용하나요?
UPPER_SNAKE_CASE(SCREAMING_SNAKE_CASE라고도 함)는 상수의 명명 규칙입니다. 예: MAX_RETRY_COUNT, API_BASE_URL. Python, Java, JavaScript에서 전역 상수와 열거형 값에 사용됩니다.
토크나이저는 어떻게 작동하나요?
camelCase 경계(소문자→대문자 전환), 언더스코어, 하이픈, 점, 슬래시, 공백을 감지하여 단어 토큰으로 분할한 다음, 대상 형식의 규칙에 따라 재조합합니다.
dot.case와 path/case의 용도는?
dot.case는 점으로 단어를 구분합니다(hello.world). 설정 파일 키와 Java 패키지 이름에 일반적입니다. path/case는 슬래시로 구분하며(hello/world), 파일 경로와 URL 세그먼트에 사용됩니다.