snake_case Converter
Convert text to snake_case — words joined with underscores, all lowercase.
0 words0 chars
0 words0 chars
What is snake_case?
snake_case writes compound words or phrases with a lowercase underscore between each word, and all letters lowercase. The name refers to the long, flat appearance — like a snake lying flat.
| Input | snake_case output |
|---|---|
| hello world | hello_world |
| user first name | user_first_name |
| background color | background_color |
| created at timestamp | created_at_timestamp |
Where snake_case is used
- Python: variable names, function names, module names (PEP 8 style guide)
- Ruby: variable and method names
- Database columns:
user_id,created_at,first_name - File names: especially in Python projects
- REST API query parameters:
?sort_by=created_at
SCREAMING_SNAKE_CASE is the uppercase variant — used for constants in Python, C, Java, and environment variables: MAX_RETRY_COUNT, DATABASE_URL.
Frequently asked questions
Python's official style guide (PEP 8) specifies snake_case for variable names, function names, and module names. PascalCase is used for class names. camelCase is not recommended for Python.
snake_case uses underscores as separators (hello_world). kebab-case uses hyphens (hello-world). kebab-case is preferred for URLs and CSS class names; snake_case is preferred for Python and database identifiers.