Convert text to snake_case

Turn a phrase into snake_case with underscores. Use it for Python names, database columns, and file names, then uppercase it for environment variables.

Characters 0 Words 0 Sentences 0 Lines 0 Reading time 0 sec

Letter case

Code formats

Click a format to convert the text in the box. The text stays in this browser.

What snake_case does

snake_case separates words with underscores and writes every letter in lower case. "User Login Count" becomes "user_login_count". Hyphens and spaces become underscores. camelCase and PascalCase are split before the underscores are added, so "userLoginCount" becomes "user_login_count".

Python variables, many database columns, and a lot of file names use this pattern. Ruby and PHP use it widely too.

Before and after

Inputsnake_case
Last Login Atlast_login_at
user-login-countuser_login_count
getHttpResponseget_http_response

Environment variables are the same shape in upper case: LAST_LOGIN_AT. Make snake_case first, then open UPPER CASE and convert the result. Doing it in that order keeps the underscores.

If the destination is a URL or a CSS class, you usually want hyphens instead. That format is kebab-case. If the destination is a JavaScript variable, use camelCase.

Other formats

Questions

Is the text uploaded?

No. Conversion happens in this browser. The text is not sent to a ToolsNowPro server.

Does the result cost anything?

No. You can copy or download it without an account.

Will proper names stay capitalized?

Only if the format you chose keeps them. Sentence case lowercases the sentence first, so check names afterward.

When should I use snake_case?

Turn a phrase into snake_case with underscores. Use it for Python names, database columns, and file names, then uppercase it for environment variables.

Need a count instead of a new case? Use the word counter. Need placeholder copy while you design? Use the lorem ipsum generator.

Find your next tool