What is snake_case, and what is this converter for?
Snake case is a naming convention where every word in a phrase is lowercased and joined together with underscores β turning "First Name" or "firstName" into first_name. This tool converts any input β plain sentences, hyphenated phrases, or camelCase/PascalCase variable names β into snake_case instantly, entirely as JavaScript inside your browser. There's no upload and no server round-trip, so your code or data never leaves your device.
How word boundaries are detected
The converter splits your input wherever a new word logically begins: at spaces, hyphens, underscores, and at the transition from a lowercase letter to an uppercase letter (as in "firstName" β "first" + "Name"). It also handles consecutive capitals correctly, so "UserID" becomes user_id rather than user_i_d. Detected words are then rejoined using the rules of whichever case style you select.
snake_case vs. SCREAMING_SNAKE_CASE
snake_case uses lowercase letters and is the standard for variable and function names in Python, Ruby and Rust. SCREAMING_SNAKE_CASE (also called CONSTANT_CASE) uses uppercase letters and underscores, and is the near-universal convention for constants and environment variables across almost every language, including MAX_RETRY_COUNT or DATABASE_URL.
Where snake_case is used
- Python, Ruby & Rust β the official style guide convention for variable and function names.
- Database columns β most SQL databases use snake_case for table and column names.
- Environment variables β typically written in SCREAMING_SNAKE_CASE, like
API_SECRET_KEY. - File & directory names β many command-line tools and static site generators prefer snake_case file names.
- Configuration keys β YAML and JSON config files commonly use snake_case for readability.
Naming convention comparison
| Case style | Example | Common use |
|---|---|---|
| snake_case | first_name | Python/Ruby/Rust variables, DB columns |
| SCREAMING_SNAKE_CASE | FIRST_NAME | Constants, environment variables |
| camelCase | firstName | JavaScript/Java variables & functions |
| PascalCase | FirstName | Class names, C#/Java types, React components |
| kebab-case | first-name | URL slugs, HTML attributes, CSS classes |