Examples:
user-id → user_id
first-name → first_name
total-amount-calculated → total_amount_calculated
api-response-data → api_response_data
is-active-flag → is_active_flag
How to Use This Tool
Our Kebab Case to Snake Case Converter is simple to use:
- Type or paste your kebab-case text in the input box
- Click the "Convert to snake_case" button
- Copy the converted result from the output box
What is kebab-case and snake_case?
kebab-case (also called hyphen-case) is a naming convention where words are separated by hyphens (-). It's widely used in HTML attributes, CSS classes, and URL slugs.
snake_case is a naming convention where words are separated by underscores (_). It's commonly used in Python, Ruby, and database column names.
Why Convert Between Naming Conventions?
Different technologies use different conventions. You might need to convert between these styles when:
- Converting HTML attributes to Python variable names
- Mapping CSS class names to database column names
- Processing URL slugs in backend code
- Working with APIs that use different naming conventions
- Enforcing consistent style guides across projects
Common Use Cases
- Converting CSS class names to Python variables
- Processing HTML data attributes in backend code
- Normalizing URL slugs for database storage
- Migrating frontend identifiers to backend models
- Preparing web data for Python/Ruby processing
Technical Details
This converter handles all edge cases including:
- Multiple consecutive hyphens
- Leading/trailing hyphens
- Mixed case input (converts to lowercase)
- Multiple lines or comma-separated values
- Special characters (ignores non-alphanumeric except hyphens)