Text Tools
snake_case converter.
Turn a phrase, camelCase or kebab-case name into snake_case, or CONSTANT_CASE for constants. One name per line.
Your text
Result
Type or paste text above and the result appears here.
About this snake_case converter
snake_case writes every word in lowercase and joins them with underscores: First Name becomes first_name. CONSTANT_CASE is the same in capitals (FIRST_NAME). The same engine also gives kebab-case (first-name) and dot.case (first.name).
How the words are found
- Spaces, hyphens, dots and other punctuation separate words and become a single separator.
- camelCase and PascalCase are split at each capital:
userIdgivesuser_id, andXMLHttpRequestgivesxml_http_request. - Digits are kept with the word before them, so
version2Betagivesversion2_beta. - Apostrophes are removed and each line is converted on its own.
Where each style is used
PEP 8 recommends lowercase names with words separated by underscores for Python functions and variables, and all-capitals with underscores for constants. Oracle's Java conventions also write constants in capitals with underscores. For web addresses, Google recommends hyphens rather than underscores between words, which is the kebab-case option here.
Examples
| Input | Case | Result |
|---|---|---|
First Name | snake_case | first_name |
userId | snake_case | user_id |
XMLHttpRequest | snake_case | xml_http_request |
max retry count | CONSTANT_CASE | MAX_RETRY_COUNT |
My Blog Post Title | kebab-case | my-blog-post-title |
More: All 13 cases in one place: Case Converter · Uppercase Converter · Lowercase Converter · Title Case Converter · Sentence Case Converter · camelCase Converter · Alphabetical Order Sorter
Sources (retrieved October 2026): PEP 8, Naming Conventions; Google JavaScript Style Guide, Naming; Oracle, Java Code Conventions, Naming Conventions; Google Search Central, URL structure.
FAQ: snake_case converter
How do I convert text to snake_case?
Type or paste the phrase. Each word is lowercased and the words are joined with underscores. Use the buttons for CONSTANT_CASE, kebab-case or dot.case.
How do I convert camelCase to snake_case?
Paste the camelCase name. The converter splits it at each capital letter, so myVariableName becomes my_variable_name, and acronyms stay together (parseHTMLString becomes parse_html_string).
Should I use underscores or hyphens in URLs?
Google recommends hyphens to separate words in a URL, because it treats them as word separators, while underscores are not. Use the kebab-case button for slugs, or the slug generator.
Can I convert a whole list?
Yes. Put one name per line; each line is converted separately and the line breaks are kept.