gettoolz.app

PascalCase to snake_case

Convert PascalCase to snake_case in your browser: UserProfile becomes user_profile. With 6 examples, acronyms and digits included — one of them does not convert back unchanged, and the page shows why. Free, nothing uploaded.

Part of writing tools and developer tools.

Your text

camelCase

userProfile

PascalCase

UserProfile

snake_case

user_profile

SCREAMING_SNAKE_CASE

USER_PROFILE

kebab-case

user-profile

Title Case

User Profile

Sentence case

User profile

lower case

user profile

UPPER CASE

USER PROFILE

PascalCase to snake_case examples

PascalCase to snake_case examples
PascalCasesnake_caseCopy
UserProfileuser_profile
LineItemline_item
HttpClienthttp_client
HTTPClienthttp_client
OAuth2Tokeno_auth2_token
S3Buckets3_bucket

One row does not survive the round trip back to PascalCase: http_client comes back as HttpClient, not HTTPClient. The converter keeps only the words, lowercased, so the capitals of an acronym and the place of a separator before a digit are gone once the text is converted.

Where you convert PascalCase to snake_case

Class names becoming file and table names: Python keeps class UserProfile in user_profile.py, Ruby’s Zeitwerk autoloader expects HttpClient in http_client.rb, and Rails maps a LineItem model to a line_items table — pluralising as well, which this converter does not. Acronyms are where the rules part ways: HTTPClient comes out as http_client here, but Zeitwerk needs an inflection to find it there.

How the conversion works

The converter first reads OAuth2Token as the words o / auth2 / token — splitting on spaces, underscores and hyphens, before every capital that follows a lowercase letter or a digit, and before the last capital of a run that starts a new word (HTTPResponse is HTTP / Response). Then it joins the lowercase words with underscores: o_auth2_token. Since it starts from the words and not from the PascalCase spelling, text already in any other case gives the same result.

Other conversions

Going the other way? snake_case to PascalCase.

Or open the full case converter and see your text in all nine cases at once.