命名风格转换

驼峰、下划线、短横线、常量名互转。

命名驼峰snake
关于「命名风格转换」

它属于「开发辅助」分类:前端与后端开发中经常用到的小工具。

  • 自动识别输入的命名风格并拆分成单词,再按目标风格重新拼接。
  • 能正确处理连续大写:HTTPResponseCode 会拆成 http + response + code。
  • 支持批量转换,每行一个标识符,结果按行对应。
  • 点击任意结果即可复制;多行时会连同换行一起复制。
  • 常用于在不同语言规范之间迁移代码,例如 Java 的驼峰与 Python 的下划线。

完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。

相关关键词:命名风格转换、开发辅助、命名、驼峰、snake、在线工具、免费

如何使用「命名风格转换」
  1. 打开工具:打开「命名风格转换」页面,无需注册、无需安装任何软件。
  2. 准备输入:粘贴标识符,在驼峰、下划线、短横线与常量名之间互转。
  3. 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
  4. 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
  5. 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
常见问题
各种命名风格分别用在哪里?
小驼峰常见于 Java、JavaScript 的变量与方法;大驼峰用于类名;下划线是 Python、Ruby 和数据库字段的惯例;短横线多用于 CSS 类名和 URL;常量名则统一用大写加下划线。
连续大写的缩写能正确处理吗?
可以。拆分规则会识别“连续大写后跟一个大写加小写”的边界,因此 XMLHttpRequest 能正确拆成 xml + http + request。
中文可以转换吗?
命名风格转换针对的是英文标识符。中文没有大小写和词边界的概念,输入中文会原样保留。

返回崽崽工具箱首页

Naming Style Converter

Camel, snake, kebab and constant case conversion.

namingcamelsnake
About Naming Style Converter

Belongs to “Dev Tools”: Small utilities frequently used in front-end and back-end development.

  • Auto-detects the input naming style, splits into words, then re-joins in the target style.
  • Handles consecutive capitals: HTTPResponseCode splits into http + response + code.
  • Supports batch conversion — one identifier per line, results align per line.
  • Click any result to copy; multi-line copies include the newlines.
  • Handy when porting code between conventions, e.g. Java’s camelCase and Python’s snake_case.

Free, no sign-up; everything runs locally in your browser and files are never uploaded.

Keywords: Naming Style Converter, Dev Tools, naming, camel, snake, online tool, free

How to use Naming Style Converter
  1. Open the tool:Open the “Naming Style Converter” page — no sign-up and nothing to install.
  2. Prepare the input:Paste an identifier to convert between camelCase, snake_case, kebab-case and CONSTANT_CASE.
  3. Provide the input:Paste your content into the input box or drop a file onto the page; you can also click “Sample” to try example data first.
  4. Adjust options and run:Adjust the options if needed, then click the process / convert / generate button.
  5. Get the result:Everything runs locally in your browser; copy or download the result — your files are never uploaded.
FAQ
Where are the styles used?
camelCase is common in Java/JS variables and methods; PascalCase for class names; snake_case in Python, Ruby and DB fields; kebab-case in CSS classes and URLs; constants use UPPER_SNAKE_CASE.
Are consecutive-capital acronyms handled?
Yes. The splitter detects the boundary “all-caps then Upper+lower”, so XMLHttpRequest correctly becomes xml + http + request.
Can Chinese be converted?
Naming-style conversion targets English identifiers. Chinese has no case or word boundaries, so it is preserved as-is.

Back to Zaizai Tools home