✨ Free · No sign-up · Runs in your browser

snake_case Converter

Turn any phrase into snake_case for variables, database columns and file names. Free and private.

Writing

Code

Other

Clean up

0 characters 0 without spaces 0 words 0 sentences 0 lines 0 min read

Shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + Z undoes the last clean-up.

What snake_case is

snake_case writes everything in lowercase and joins words with underscores, for example user_first_name. It is the usual style in Python, Ruby, SQL column names and many file names.

How to use the converter

Paste a phrase or a camelCase name. With snake_case selected, the result shows the underscore version. Click Copy to use it.

snake_case vs kebab-case

kebab-case uses hyphens instead of underscores, for example user-first-name. It is common in URLs and CSS. CONSTANT_CASE is snake_case in capitals and is used for constants.

Tips

Pick one style and use it consistently. Avoid spaces and special characters in names, and keep names readable.

How the converter builds a name

It splits your text into words, lowercases them and joins them with underscores. Spaces, hyphens, dots and other punctuation are treated as word breaks, repeated separators collapse into one underscore, and names that are already joined are split at their capital letters.

You typesnake_case result
user first nameuser_first_name
userFirstNameuser_first_name
getHTTPResponseget_http_response
My Blog Post Title!my_blog_post_title
Order #42 – shipped (UK)order_42_shipped_uk
café au laitcafé_au_lait

Paste several lines and each one becomes its own name, so a column of labels converts in one go. For the shouting version, pick CONSTANT_CASE: max retry count becomes MAX_RETRY_COUNT.

Where snake_case is the norm

snake_case or kebab-case for web addresses?

For URLs, use kebab-case rather than snake_case. Google's URL structure guidance recommends separating words with hyphens rather than underscores. Use snake_case inside code and databases, and hyphens in page addresses.

Check these before you use the result

More converters: Uppercase to Lowercase Converter · Lowercase to Uppercase Converter · Capitalize Text Online · camelCase Converter · Title Case Converter · Sentence Case Converter · All case options

Questions

Can it convert camelCase to snake_case?
Yes. Paste the camelCase name and the words are split at each capital letter.
Does it change capital letters?
Yes. snake_case is all lowercase.
What is snake_case used for?
Variable and function names in Python, Ruby and Rust, database table and column names, and data keys, where words are joined with underscores.
Is snake_case or kebab-case better for URLs?
kebab-case. Google's URL structure guidance recommends hyphens, not underscores, to separate words in a web address.
What happens to punctuation and extra spaces?
Punctuation and repeated spaces are treated as word breaks, so hello world! becomes hello_world.

All converters: Uppercase to Lowercase · Lowercase to Uppercase · ALL CAPS Converter · ALL CAPS to Sentence Case · Capitalize Text · Title Case · Sentence Case · Toggle Case · Alternating Case · camelCase · PascalCase · kebab-case · CONSTANT_CASE & dot.case