🔨 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)中使用
- 计算结果仅供参考,请以实际应用场景为准