snake_case Converter
Convert text to snake_case — the standard naming convention for Python variables, Ruby methods, and SQL column names.
About snake_case Converter
snake_case is a naming convention where all letters are lowercase and words are separated by underscores. Examples: first_name, get_user_by_id, my_variable_name. It is the dominant convention in Python (PEP 8), Ruby, PHP (variables and methods), SQL column names, and Rust.
This converter works with input in any format — spaces, hyphens, camelCase, PascalCase — and produces clean snake_case output. It correctly handles camelCase by inserting underscores before each uppercase letter before lowercasing everything.
FAQ
What is the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (myVariableName) while PascalCase (also called UpperCamelCase) starts with an uppercase letter (MyClassName). PascalCase is typically used for class names and component names, while camelCase is used for variables and methods.
Which case convention should I use?
Follow the convention of your language and framework. JavaScript/TypeScript: camelCase for variables, PascalCase for classes. Python: snake_case for everything (PEP 8). CSS: kebab-case for class names. SQL: snake_case for column names. Go: camelCase for unexported, PascalCase for exported identifiers.