snake_case converter
Converted in your browser · nothing is uploaded
Converts text to snake_case: everything lowercase, words joined with underscores. `User First Name` becomes `user_first_name`.
How to use the snake_case converter
snake_case is the convention in Python, Ruby, Rust and — most consequentially — in SQL. The SQL reason is worth knowing because it explains a class of bug: unquoted identifiers in SQL are case-insensitive, and PostgreSQL folds them to lowercase. So a column created as firstName is really firstname, and querying SELECT "firstName" with quotes fails while SELECT firstName works and returns firstname. Using snake_case avoids the whole problem, which is why almost every database convention mandates it.
SCREAMING_SNAKE_CASE — the same thing in capitals — is the near-universal convention for constants and environment variables. Environment variables are conventionally uppercase for a historical reason that still bites: shell variable names are case-sensitive, and uppercase distinguishes exported configuration from local shell variables. A lowercase env var works but reads as a mistake to anyone else.
When converting from camelCase, the boundary is found at each capital letter, so firstName becomes first_name and parseHTTPResponse becomes parse_h_t_t_p_response — which is why the acronym advice on the camelCase page matters. Text that was written parseHttpResponse round-trips cleanly; text with a run of capitals does not.
Questions
Unquoted SQL identifiers are case-insensitive and PostgreSQL folds them to lowercase, so firstName silently becomes firstname. snake_case avoids it entirely.