toolqik

170 · Text

Snake Case Converter

Convert names and phrases to snake_case for Python, Ruby and databases.

Runs in your browser
Options
Snake Case

  

About this tool

snake_case writes words in lowercase joined by underscores: user_profile_id. It’s the standard for variables and functions in Python (PEP 8), Ruby and Rust, and the most common style for database tables and columns, where unquoted identifiers are case-insensitive anyway. Paste names in any style, one per line.

CaseExampleTypical use
camelCaseuserProfileIdJavaScript, Java and C# variables and functions; JSON keys
PascalCaseUserProfileIdClasses and types in most languages; C# methods; React components
snake_caseuser_profile_idPython, Ruby and Rust variables; database columns
kebab-caseuser-profile-idURLs, CSS classes, HTML attributes, file names, CLI flags
CONSTANT_CASEUSER_PROFILE_IDConstants and environment variables

How words are detected

Input can be in any style: spaces, snake_case, kebab-case, camelCase or PascalCase. Words are split at spaces, underscores, hyphens and other punctuation, at lowercase-to-uppercase changes (userId → user, Id), and at acronym boundaries (XMLHttpRequest → XML, Http, Request). Each line is converted separately, so you can paste a whole list of names at once. Letters with accents and non-Latin scripts are kept.

Converting API fields

A frequent job is mapping a JavaScript API’s camelCase keys to Python or database snake_case: createdAt → created_at, XMLHttpRequest → xml_http_request. Paste the list of keys to convert them all at once. Libraries such as Pydantic (with an alias generator) or Jackson (SNAKE_CASE naming strategy) can do it automatically at runtime.

Turn on SCREAMING_SNAKE_CASE for constants and environment variables, or use the constant case converter.

FAQ

What is snake_case?

A naming style with lowercase words separated by underscores, such as user_profile_id. It is standard in Python, Ruby, Rust and SQL databases.

How do I convert camelCase to snake_case?

Paste the camelCase names, one per line. userProfileId becomes user_profile_id, and acronyms are split correctly (parseHTTPResponse → parse_http_response).

What is SCREAMING_SNAKE_CASE?

snake_case in capital letters, like MAX_RETRY_COUNT. It is used for constants and environment variables.

Should database columns use snake_case?

It is the most common convention. PostgreSQL folds unquoted names to lowercase, so camelCase columns need quoting everywhere.

esc
↑↓ navigate↵ open