Convert text to snake_case

snake_case joins your words with underscores and lowercases everything. Paste user profile data and get user_profile_data. The format is the standard for variables and functions in Python, Ruby, and Rust, and for column names in most SQL databases. For uppercase variants, see CONSTANT_CASE; for dashes instead of underscores, see kebab-case.

Input
Line 1:1 LF cloud_done Saved locally
Result snake_case
0 lines 0 chars

Identifiers for Python, Ruby, and SQL

snake_case is the identifier style used for variables, functions, and module names in Python (PEP 8), Ruby, Rust, and most SQL dialects for column and table names. user profile data becomes user_profile_data: every word lowercased, joined with single underscores, no other separators.

The engine first tokenises your input by replacing underscores and dashes with spaces, splitting on lowercase-to-uppercase transitions, lowercasing everything, and splitting on whitespace. The resulting tokens are then joined with _. The result is a clean snake_case identifier regardless of how the input was formatted.

Style-guide notes: Python's PEP 8 specifies snake_case for function and variable names, with PascalCase reserved for classes. Ruby uses snake_case for methods and locals. Rust uses snake_case for functions, locals, and modules; PascalCase for types. SQL traditionally uses snake_case for identifiers (column names, table names) so that unquoted lookups behave the same regardless of database case-folding rules. For an uppercase variant used for constants, see CONSTANT_CASE.

How to use convert text to snake_case

  1. 1Paste or type your phrase into the input panel on the left.
  2. 2The snake_case identifier appears in the output panel on the right as you type.
  3. 3Mixed input is fine: UserProfile, user-profile, and user profile all produce user_profile.
  4. 4Click Copy in the output header to paste the identifier into your code or SQL.
  5. 5For an uppercase constant, switch to CONSTANT_CASE; for dashes, use kebab-case.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Word boundary detection

Same tokeniser as camelCase. Underscores, dashes, whitespace, and lowercase-to-uppercase transitions all count as word boundaries, so any input format produces a consistent output.

Lowercase joining

Tokens are emitted in lowercase and joined with a single underscore. USER PROFILE -> user_profile. For uppercase output (USER_PROFILE), use CONSTANT_CASE instead.

Already-formatted input round-trips

Pasting user_profile_data back in still produces user_profile_data. The tokeniser splits on the existing underscores, lowercases each token, and rejoins.

Multiple separators collapse

Runs of underscores, dashes, or spaces collapse to a single underscore in the output. user---profile and user__profile both become user_profile.

Pairs with the case family

Sibling tools share the same tokeniser. camelCase for first-letter caps, PascalCase for class names, kebab-case for URLs, CONSTANT_CASE for constants, dot.case for namespacing, Train-Case for headers.

Worked example

Spaces, dashes, and shouty caps all collapse to the same snake_case result. The tokeniser normalises every input format into the same lowercase, underscore-joined identifier.

Input
user profile data
fetch-user-by-id
USER ID lookup
Output
user_profile_data
fetch_user_by_id
user_id_lookup

Settings reference

Input snake_case output
user profile user_profile
user-profile user_profile
UserProfile user_profile (boundary via lower-to-upper split)
USER PROFILE user_profile
user---profile user_profile (runs collapse to single underscore)
user2 profile user2_profile (digits stick to their word)

FAQ

Will it handle camelCase input?
Yes. The tokeniser splits on lowercase-to-uppercase transitions, so userProfileData produces user_profile_data. The same applies to PascalCase input.
How is snake_case different from CONSTANT_CASE?
snake_case is all lowercase (user_profile); CONSTANT_CASE is all uppercase (USER_PROFILE). Both use underscores as separators. snake_case is for variables and functions; CONSTANT_CASE is for constants and environment variables.
What happens to runs of separators?
They collapse. user--profile, user__profile, and user profile all produce user_profile with a single underscore between words.
Will it work for SQL column names?
Yes. snake_case is the standard naming style in PostgreSQL, MySQL, and SQLite. The tool produces lowercase, underscore-joined identifiers that round-trip through unquoted SQL.
How do I convert to other identifier styles?
Use camelCase or PascalCase for joined identifiers, kebab-case for dashes, CONSTANT_CASE for upper-snake, dot.case for dots, or Train-Case for capitalised dashes.