snake_case Converter for Code and Database Names
Paste plain text, camelCase or kebab-case below and click snake_case. Words become lowercase and are joined with underscores. Each line is converted separately, which makes it easy to rename a list of columns at once.
Examples
User First Name
user_first_name
createdAtDate
created_at_date
background-color
background_color
Where snake_case Is the Convention
- Variables and functions in Python, as recommended by PEP 8
- Variables and methods in Ruby
- Variables and functions in Rust
- Table and column names in many SQL databases
- Property names in some JSON APIs
Why snake_case Suits Database Columns
Some databases fold unquoted names to a single case. PostgreSQL, for example, turns an unquoted createdAt into createdat. Lowercase names with underscores stay readable and avoid the need to quote them in every query.
snake_case vs kebab-case
The two look alike, but hyphens read as a minus sign in most programming languages, so they cannot be used in variable names. Underscores are allowed, which is why snake_case is common in code and kebab-case is more common in URLs and CSS.
Other Case Converters
Frequently Asked Questions
snake_case writes words in lowercase and joins them with underscores, as in user_first_name.
Paste your camelCase text into the box above and click snake_case. The tool splits words at each capital letter, so createdAtDate becomes created_at_date.
Click snake_case first, then click UPPER CASE. For example, max retries becomes max_retries and then MAX_RETRIES.