大小写转换器

在不同文本大小写样式之间转换

大写
-
小写
-
标题大小写
-
句子大小写
-
驼峰式
-
帕斯卡式
-
蛇形式
-
短横线式
-
常量式
-
最后更新:

关于此工具

命名风格转换器可在 camelCase、PascalCase、snake_case、kebab-case、CONSTANT_CASE 等编程命名约定之间互相转换。不同语言和框架习惯不同 — JavaScript 用 camelCase,Python 用 snake_case,CSS 用 kebab-case,环境变量用 CONSTANT_CASE。

使用方法

  1. Type or paste the text you want to convert into the input box.
  2. All conversion variants render simultaneously in the results grid.
  3. Find the case style you need (camelCase, kebab-case, etc.) in the appropriate card.
  4. Click Copy on that card to put the result on your clipboard.
  5. Paste it into your IDE, terminal, config file, or commit message.

常见用例

  • Renaming a database column (snake_case) into a TypeScript field (camelCase).
  • Generating CSS class names (kebab-case) from a design token name.
  • Converting JSON keys to match a different language convention during API integration.
  • Producing CONSTANT_CASE keys for .env files from a human-readable label.
  • Quickly producing a PascalCase class name from a feature description in a ticket.
  • Normalizing inconsistent variable names during a refactor.

常见问题

Q. What is the difference between camelCase and PascalCase?

A. Both join words without separators, but camelCase keeps the first letter lowercase (myVariable) while PascalCase capitalizes it (MyClass). PascalCase is conventionally reserved for classes, types, and components.

Q. How do you handle acronyms like URL or ID?

A. Modern style guides (Google, Microsoft) treat acronyms as single words: parseUrl, userId. The converter follows that rule for predictable round-trip conversions.

Q. Will the tool guess word boundaries from a CONSTANT_CASE input?

A. Yes. It splits on underscores, hyphens, spaces, and case transitions, so HELLO_WORLD, helloWorld, and hello-world all produce the same canonical word list before re-joining.

Q. Does conversion work with non-English characters?

A. Yes for case-insensitive scripts. Languages without case (Korean, Japanese, Chinese) keep their characters intact and only the separators are adjusted.