How to convert text to snake_case
- Paste your words or names into Input, one per line.
- Each line becomes a lowercase name with underscores between the words.
- Copy the result or download it as a text file.
Where snake_case is used
Python’s style guide, PEP 8, uses snake_case for variable, function and module names, and Ruby does the same for methods and variables. It’s also the most common style for database table and column names, because many databases treat unquoted names without regard to case, so userName and username would clash while user_name stays readable. Rust uses snake_case for variables and functions too.
A typical use is turning the headings of a spreadsheet into column names for a database import: Total price (EUR) becomes total_price_eur, ready to use.
Each line is one name
The converter works line by line, so a list of fifty column headings gives back fifty snake_case names in the same order. Words are found at spaces, punctuation, hyphens and lowercase-to-capital changes, then lowercased and joined with underscores. For hyphens instead of underscores, use the kebab-case converter.