🔨 Case Converter
Switch text between camelCase, snake_case, PascalCase, kebab-case and more — instantly, in your browser.
📐 工作原理與說明
Tokenize into words, then rejoin for each style: camelCase = lower-case first word + capitalized following words; snake_case = lower case joined by underscores; kebab-case = lower case joined by hyphens; PascalCase = each word capitalized; CONSTANT_CASE = upper case joined by underscores; dot.case = lower case joined by dots; Title Case = capitalize each whitespace-separated word, keep inner case; Sentence case = lower-case normal words, then capitalize the first Unicode letter at the start, after line breaks and after . ! ? 。!? (skipping opening quotes/brackets); toggle case = swap each character case.
在多種命名風格之間轉換文本,是程式碼與文案整理的常用工具。
- 風格:lower、UPPER、Title Case、camelCase、PascalCase、snake_case、kebab-case、CONSTANT_CASE。
- Tokenization: split on spaces, underscores, hyphens, punctuation and case boundaries, then rejoin in the target style; naming styles can optionally keep punctuation.
- 規則:camelCase 首詞全小寫、後續詞首字母大寫;snake/kebab 用
_/-連線並統一大小寫。 - 注意:縮寫詞(ID、URL、API)可能被拆散,轉換後需人工校對。
Naming styles split on punctuation and spaces. A result starting with a digit, or colliding with a target-language keyword, still needs manual renaming; this tool does not validate identifier legality.
📄 0 字元
💬 0 詞
📄 0 行
📚 深度解析:大小寫轉換器
💡 常見使用場景
- camelCase/snake_case/kebab-case 互轉。
- 批次整理常量與變數名:把介面返回的 snake_case 欄位批次轉成 camelCase 以契合前端命名規範,或反向轉換以適配後端。
轉換
`my cool Var` → camelCase `myCoolVar`、snake `my_cool_var`。
❓ 常見問題(FAQ)
- 空格怎麼處理?
- 通常轉分隔符(_/-)或去掉。
- 為什麼 Title Case 會把 of、the 也大寫?
- 嚴格的 Title Case 規則只按空格切詞、對每個詞首字母大寫,不識別語法。出版規範(如 APA)會保留冠詞與短介詞小寫。若需符合出版風格,轉換後請人工檢查 a/an/the、of/in/on 等詞。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Naming styles | camelCase / snake_case / kebab-case / PascalCase | Common naming conventions |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準