A form field label
"User First Name" becomes user_first_name — words joined with underscores, all lowercase.
Convert text to snake_case instantly for Python variables and database columns — free.
About
Joins words with underscores in lowercase — "user first name" becomes "user_first_name". It's the standard naming convention for variables in Python and Ruby, and for many SQL database column names, where hyphens aren't valid identifier characters anyway.
Every run of non-letter characters becomes a single underscore and every letter is lowercased, so "First Name", "first-name" and "FIRST.NAME" all become "first_name". Apostrophes count as separators too — "customer's id" becomes "customer_s_id" — so remove them first if you don't want the extra word.
Examples
4 worked examples
"User First Name" becomes user_first_name — words joined with underscores, all lowercase.
"Total Invoice Amount Due" becomes total_invoice_amount_due, ready to use as a Python or Ruby variable name.
"first-name-field" becomes first_name_field — hyphens convert to underscores too.
"Calculate Total Price" converts to calculate_total_price, ready to use as a function name.
FAQ
Quick answers to common questions about the snake_case Converter.
Type or paste your text above and click snake_case (or just start typing — this page previews snake_case live). Copy the result when you're done.
Yes. It's free, with no sign-up and no limit on how much text you convert.
snake_case joins words with underscores in lowercase, the standard naming convention for variables in Python and for many SQL column names.
A hyphen in an unquoted SQL identifier reads as a minus sign, so column and table names use underscores instead — which is exactly why snake_case, not kebab-case, is the SQL convention.
Yes — the same tool handles UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase and kebab-case. Click any of the buttons below the input, or use one of the dedicated pages below.
It's snake_case in capitals, used for constants and environment variables such as MAX_RETRIES or DATABASE_URL. The same tool has a CONSTANT_CASE button that produces exactly that from any phrase.
No — it only splits on spaces and punctuation, so "userName" becomes username rather than user_name. Put a space between the words first, such as "user Name", to get user_name.
Punctuation is treated as a separator and removed, digits stay as their own word, and accented Latin letters are kept: "Café menu 2024!" becomes café_menu_2024. Characters from non-Latin scripts are dropped.
Yes. Python's PEP 8 style guide recommends snake_case for function and variable names, PascalCase for classes and CONSTANT_CASE for constants. Ruby and Rust use the same convention for functions and variables.
Did snake_case Converter work for you?