How To Convert Text To snake_case
Learn what snake_case is, why Python and SQL favor it, and how to convert any phrase into a snake_case identifier.
Quick Answer
This snake case converter (also called underscore case) writes everything in lowercase and joins words with underscores: "user profile image" becomes "user_profile_image". It follows the standard python naming convention for variables and functions, and is equally common for SQL database column names.
Try The snake_case Converter →Where snake_case Is Used
Python uses snake_case for almost everything except class names. SQL traditionally uses it for column and table names because keywords are case-insensitive and lowercase identifiers behave consistently. The all-caps variant, SCREAMING_SNAKE_CASE, is common for constants.
How The Conversion Works
The converter splits your text into words at spaces, hyphens, underscores, and camelCase humps, lowercases each word, and joins them with underscores. For example, "getUserProfile", "get-user-profile", and "Get User Profile" all become "get_user_profile". Every line is converted on its own, so you can transform a whole column of names at once.
This tool is free and runs online entirely in your browser. Your text stays on your device, protecting your privacy: nothing is uploaded to a server, and results appear instantly.
Common Mistakes
snake_case vs Other Naming Conventions
snake_case is one of several alternatives for naming identifiers. camelCase is the standard for JavaScript, Java, and Swift: no separators, capital letter marks each word. kebab-case uses hyphens instead of underscores and is common for CSS and URL slugs, but most programming languages cannot use it for variable names. PascalCase is used for class names in most languages. snake_case's main advantage over these alternatives is readability: every word is lowercase and clearly separated, which is why it is the dominant style in Python, SQL, and Rust.