CamelCase Snake_case Converter

Convert between camelCase and snake_case naming conventions, supports batch conversion

Conversion Rules

CamelCase to snake_case

userName โ†’ user_name
getUserInfo โ†’ get_user_info
XMLHttpRequest โ†’ xml_http_request

snake_case to camelCase

user_name โ†’ userName
get_user_info โ†’ getUserInfo
xml_http_request โ†’ xmlHttpRequest

Tool Overview: CamelCase Snake_case Converter

What Is CamelCase Snake_case Converter?

CamelCase Snake_case Converter converts strings to camel/snake case for consistent naming.

How to Use

  1. Paste the text or list.
  2. Select camel/snake case as the output style.
  3. Copy the converted result.

Common Use Cases

  • Unify variable and function naming
  • Convert API or DB field names
  • Batch renaming tasks

โ“ FAQ

Q1: Separators look wrong?
A: Check tokenization and input separators.

Q2: Batch conversion?
A: Use multiline input.

Q3: Keep numbers?
A: Numbers are preserved in output.

Tool Overview

The CamelCase Snake_case Converter is a professional naming convention converter that supports mutual conversion between camelCase and snake_case naming conventions.

Key Features

๐Ÿ”„ Bidirectional Conversion

  • CamelCase to snake_case: Convert userName to user_name
  • snake_case to camelCase: Convert user_name to userName

๐Ÿ“ Batch Processing

  • Support multiple lines of text conversion simultaneously
  • Automatically recognize empty lines and maintain formatting
  • Suitable for processing large amounts of variable names

๐Ÿ”€ Smart Swap

  • One-click swap of input and output content
  • Convenient for reverse conversion operations

Conversion Rules

CamelCase to snake_case Rules

  1. Consecutive uppercase letters: XMLHttpRequest โ†’ xml_http_request
  2. Lowercase followed by uppercase: getUserInfo โ†’ get_user_info
  3. Preserve existing underscores: Keep existing underscores unchanged
  4. Convert to lowercase: Final result is all lowercase

snake_case to camelCase Rules

  1. Capitalize after underscore: user_name โ†’ userName
  2. Remove underscores: All underscores are removed
  3. Lowercase first letter: Maintain camelCase convention

Use Cases

๐Ÿ’ป Programming Development

  • JavaScript/TypeScript: API response field conversion
  • Python: Variable naming convention conversion
  • Java: Property name format unification
  • Go: Struct field conversion

๐Ÿ”— API Development

  • Frontend-backend data format unification
  • Database field to code variable mapping
  • Data exchange between different languages

๐Ÿ“Š Data Processing

  • JSON data format conversion
  • Configuration file format adjustment
  • Data import/export processing

Common Examples

Variable Name Conversion

Input: userName, firstName, lastName
Output: user_name, first_name, last_name

Function Name Conversion

Input: getUserInfo, createNewUser, deleteUserById
Output: get_user_info, create_new_user, delete_user_by_id

Complex Naming Conversion

Input: XMLHttpRequest, JSONParser, HTMLElement
Output: xml_http_request, json_parser, html_element

Important Notes

  1. Maintain Semantics: Ensure variable names remain semantically clear after conversion
  2. Team Standards: Follow project or team naming conventions
  3. Consistency: Maintain consistent naming style within the same project
  4. Readability: Prioritize code readability and maintainability

Technical Features

  • โœ… Pure frontend processing, data security
  • โœ… Real-time conversion, instant preview
  • โœ… Batch operation support
  • โœ… Smart rule recognition
  • โœ… Cross-platform compatibility